Skip to content

Commit

Permalink
Kill Microsoft.DotNet.Interactive.Http.dll. (#3214)
Browse files Browse the repository at this point in the history
Move the code into the dotnet interactive tool instead.
  • Loading branch information
shyamnamboodiripad authored Oct 3, 2023
1 parent 6acf672 commit edad190
Show file tree
Hide file tree
Showing 33 changed files with 25 additions and 94 deletions.
17 changes: 1 addition & 16 deletions dotnet-interactive.sln
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{4DD50BCA-1
docs\variable-sharing.md = docs\variable-sharing.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.Http", "src\Microsoft.DotNet.Interactive.Http\Microsoft.DotNet.Interactive.Http.csproj", "{DE942DC3-B41B-45C5-9E01-3C4F042D3916}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.AspNetCore", "src\Microsoft.DotNet.Interactive.AspNetCore\Microsoft.DotNet.Interactive.AspNetCore.csproj", "{5167FC61-2FBF-4E0D-877E-C2DD354FB955}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.SqlServer", "src\Microsoft.DotNet.Interactive.SqlServer\Microsoft.DotNet.Interactive.SqlServer.csproj", "{EBDC3450-C4C0-42C6-8D53-85FEDF897664}"
Expand Down Expand Up @@ -119,7 +117,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactiv
{1A4A744F-FEF3-4361-A2E5-C5D496F7BFDC} = {1A4A744F-FEF3-4361-A2E5-C5D496F7BFDC}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Interactive.HttpRequestParser", "src\Microsoft.DotNet.Interactive.HttpRequestParser\Microsoft.DotNet.Interactive.HttpRequestParser.csproj", "{DA0B3BFC-ED19-4754-A9A0-0F831DBCC9C4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.HttpRequestParser", "src\Microsoft.DotNet.Interactive.HttpRequestParser\Microsoft.DotNet.Interactive.HttpRequestParser.csproj", "{DA0B3BFC-ED19-4754-A9A0-0F831DBCC9C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -359,18 +357,6 @@ Global
{9A091E80-D5EB-4DEF-8E38-B24B128393DF}.Release|x64.Build.0 = Release|Any CPU
{9A091E80-D5EB-4DEF-8E38-B24B128393DF}.Release|x86.ActiveCfg = Release|Any CPU
{9A091E80-D5EB-4DEF-8E38-B24B128393DF}.Release|x86.Build.0 = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|x64.ActiveCfg = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|x64.Build.0 = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|x86.ActiveCfg = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Debug|x86.Build.0 = Debug|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|Any CPU.Build.0 = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|x64.ActiveCfg = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|x64.Build.0 = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|x86.ActiveCfg = Release|Any CPU
{DE942DC3-B41B-45C5-9E01-3C4F042D3916}.Release|x86.Build.0 = Release|Any CPU
{5167FC61-2FBF-4E0D-877E-C2DD354FB955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5167FC61-2FBF-4E0D-877E-C2DD354FB955}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5167FC61-2FBF-4E0D-877E-C2DD354FB955}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -719,7 +705,6 @@ Global
{CE412E28-8660-43CA-8E0B-293EAC624623} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
{30DE6920-EA82-4E4F-BFCA-1FF179FAA2DA} = {11BA3480-4584-435C-BA9A-8C554DB60E9F}
{9A091E80-D5EB-4DEF-8E38-B24B128393DF} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
{DE942DC3-B41B-45C5-9E01-3C4F042D3916} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
{5167FC61-2FBF-4E0D-877E-C2DD354FB955} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
{EBDC3450-C4C0-42C6-8D53-85FEDF897664} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
{79FBB52B-BC6B-44F9-9DF0-F58F2DA83EE0} = {11BA3480-4584-435C-BA9A-8C554DB60E9F}
Expand Down
9 changes: 0 additions & 9 deletions src/Microsoft.DotNet.Interactive.Http/Directory.Build.props

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
<ProjectReference Include="..\Microsoft.DotNet.Interactive.CSharp\Microsoft.DotNet.Interactive.CSharp.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Formatting.Tests\Microsoft.DotNet.Interactive.Formatting.Tests.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.FSharp\Microsoft.DotNet.Interactive.FSharp.fsproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Http\Microsoft.DotNet.Interactive.Http.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.PowerShell\Microsoft.DotNet.Interactive.PowerShell.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Jupyter\Microsoft.DotNet.Interactive.Jupyter.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Formatting\Microsoft.DotNet.Interactive.Formatting.csproj" />
Expand Down
1 change: 0 additions & 1 deletion src/dotnet-interactive.Tests/(Recipes)/LogEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public static IDisposable SubscribeToPocketLogger(this ITestOutputHelper output)
new[]
{
typeof(LogEvents).Assembly,
typeof(Startup).Assembly,
typeof(CommandLine).Assembly,
typeof(CSharpKernel).Assembly,
typeof(FSharpKernel).Assembly,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
Expand Down Expand Up @@ -145,7 +146,7 @@ await kernel.SubmitCodeAsync($@"

Action action = () => provider.GetFileInfo("extensions/TestKernelExtension/resources/file.txt");

action.Should().Throw<StaticContentSourceNotFoundException>();
action.Should().Throw<KeyNotFoundException>();
}

[Theory]
Expand Down Expand Up @@ -179,7 +180,7 @@ public void it_cannot_resolve_unregistered_extensions(Language language)
Action action
= () => provider.GetFileInfo("extensions/not_found/resources/file.txt");

action.Should().Throw<StaticContentSourceNotFoundException>();
action.Should().Throw<KeyNotFoundException>();
}

protected override CompositeKernel CreateCompositeKernel(Language defaultKernelLanguage = Language.CSharp, bool openTestingNamespaces = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public static class AspNetExtensions
internal static class AspNetExtensions
{
public static IServiceCollection AddKernel<T>(this IServiceCollection services, T kernel) where T : Kernel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class DiscoveryRouter : IRouter
internal class DiscoveryRouter : IRouter
{
private readonly HtmlNotebookFrontendEnvironment _frontendEnvironment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ string ProcessPath()
IFileProvider SelectProvider()
{
var name = parts[1];
if (!_providers.TryGetValue(name, out var embeddedFileProvider))
{
throw new StaticContentSourceNotFoundException(name);
}
return embeddedFileProvider;
return _providers[name];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class HttpApiTunnelingRouter : IRouter
internal class HttpApiTunnelingRouter : IRouter
{
private readonly HtmlNotebookFrontendEnvironment _frontendEnvironment;

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class HttpProbingSettings
internal class HttpProbingSettings
{
public Uri[] AddressList { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.AspNetCore.Http;

namespace Microsoft.DotNet.Interactive.Http;

Expand All @@ -17,7 +16,7 @@ internal static class HttpRequestExtensions
/// </summary>
/// <param name="request">The <see cref="HttpRequest"/>.</param>
/// <returns>A New Uri object representing request Uri.</returns>
public static Uri GetUri(this HttpRequest request)
public static Uri GetUri(this AspNetCore.Http.HttpRequest request)
{
if (request == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class KernelCommandAndEventSignalRHubConnectionSender : IKernelCommandAndEventSender
internal class KernelCommandAndEventSignalRHubConnectionSender : IKernelCommandAndEventSender
{
// QUESTION: (KernelCommandAndEventSignalRHubConnectionSender) tests?
private readonly HubConnection _hubConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public static class KernelExtensions
internal static class KernelExtensions
{
public static T UseHttpApi<T>(this T kernel, HttpPort httpPort, HttpProbingSettings httpProbingSettings)
where T : Kernel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class KernelHub : Hub
internal class KernelHub : Hub
{
private readonly KernelHubConnection _connection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class KernelHubConnection : IDisposable
internal class KernelHubConnection : IDisposable
{
private readonly CompositeDisposable _disposables = new();
private readonly SignalRBackchannelKernelClient _backchannelKernelClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class KernelsRouter : IRouter
internal class KernelsRouter : IRouter
{
private readonly Kernel _kernel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class SignalRBackchannelKernelClient : KernelClientBase
internal class SignalRBackchannelKernelClient : KernelClientBase
{
private IHubContext<KernelHub> _hubContext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#nullable enable
namespace Microsoft.DotNet.Interactive.Http;

public class SignalRKernelConnector
internal class SignalRKernelConnector
{
public SignalRKernelConnector(Uri hubUrl)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Microsoft.DotNet.Interactive.Http;

public class VariableRouter : IRouter
internal class VariableRouter : IRouter
{
private static readonly JsonSerializerOptions SerializerOptions;

Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-interactive/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Microsoft.DotNet.Interactive.App;

public class Startup
internal class Startup
{
public Startup(
IHostEnvironment env,
Expand Down
8 changes: 6 additions & 2 deletions src/dotnet-interactive/dotnet-interactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
Expand Down Expand Up @@ -74,7 +75,6 @@
<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.Interactive.CSharp\Microsoft.DotNet.Interactive.CSharp.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.FSharp\Microsoft.DotNet.Interactive.FSharp.fsproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Http\Microsoft.DotNet.Interactive.Http.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.HttpRequest\Microsoft.DotNet.Interactive.HttpRequest.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Mermaid\Microsoft.DotNet.Interactive.Mermaid.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Interactive.PackageManagement\Microsoft.DotNet.Interactive.PackageManagement.csproj" />
Expand Down Expand Up @@ -121,7 +121,7 @@
<Compile Include="..\Microsoft.DotNet.Interactive.Documents\JsonReaderExtensions.cs" Link="ParserServer\JsonReaderExtensions.cs" />
<Compile Include="..\Microsoft.DotNet.Interactive.Documents\Json\ByteArrayConverter.cs" Link="ParserServer\ByteArrayConverter.cs" />
<Compile Include="..\Microsoft.DotNet.Interactive\Utility\DictionaryExtensions.cs" Link="%28Recipes%29\DictionaryExtensions.cs" />
<Compile Include="..\Microsoft.DotNet.Interactive\Utility\InvocationContextExtensions.cs" Link="Utility\InvocationContextExtensions.cs" />
<Compile Include="..\Microsoft.DotNet.Interactive\Utility\InvocationContextExtensions.cs" Link="Http\Utility\InvocationContextExtensions.cs" />

<TypescriptOutputFiles Include="$(JsApiRoot)dist/dotnet-interactive.js" />

Expand Down Expand Up @@ -157,6 +157,10 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Http\" />
</ItemGroup>

<Target Name="CopyKernelSpecificFiles" DependsOnTargets="PrepareKernels;CopyLogoFiles">
<CreateItem Include="%(KernelFolders.Identity)/**/*.json" AdditionalMetadata="Destination=$([System.IO.Path]::GetFileName(%(KernelFolders.Identity)))">
<Output TaskParameter="Include" ItemName="KernelSpecificJsonFiles" />
Expand Down

0 comments on commit edad190

Please sign in to comment.