From ec1e8df3cb767e308ae8f4d6a24afddb820e1e8a Mon Sep 17 00:00:00 2001 From: Akshita Date: Wed, 22 May 2019 12:04:47 -0700 Subject: [PATCH 1/4] Add global.json and remove humanizer --- DotNetTry.sln | 7 --- MLS.Agent/MLS.Agent.csproj | 10 +--- MLS.Blazor/global.json | 5 ++ MLS.HumanizerRunner/App.cshtml | 5 -- MLS.HumanizerRunner/Linker.xml | 23 -------- .../MLS.HumanizerRunner.csproj | 32 ----------- MLS.HumanizerRunner/Pages/Index.cshtml | 4 -- MLS.HumanizerRunner/Pages/Index.cshtml.cs | 56 ------------------- MLS.HumanizerRunner/Program.cs | 21 ------- .../Properties/launchSettings.json | 27 --------- MLS.HumanizerRunner/Startup.cs | 22 -------- MLS.HumanizerRunner/wwwroot/index.html | 14 ----- MLS.HumanizerRunner/wwwroot/interop.js | 13 ----- 13 files changed, 7 insertions(+), 232 deletions(-) create mode 100644 MLS.Blazor/global.json delete mode 100644 MLS.HumanizerRunner/App.cshtml delete mode 100644 MLS.HumanizerRunner/Linker.xml delete mode 100644 MLS.HumanizerRunner/MLS.HumanizerRunner.csproj delete mode 100644 MLS.HumanizerRunner/Pages/Index.cshtml delete mode 100644 MLS.HumanizerRunner/Pages/Index.cshtml.cs delete mode 100644 MLS.HumanizerRunner/Program.cs delete mode 100644 MLS.HumanizerRunner/Properties/launchSettings.json delete mode 100644 MLS.HumanizerRunner/Startup.cs delete mode 100644 MLS.HumanizerRunner/wwwroot/index.html delete mode 100644 MLS.HumanizerRunner/wwwroot/interop.js diff --git a/DotNetTry.sln b/DotNetTry.sln index 48b2faa73..c26d571a6 100644 --- a/DotNetTry.sln +++ b/DotNetTry.sln @@ -47,8 +47,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Try.Protoc EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MLS.PackageTool", "MLS.PackageTool\MLS.PackageTool.csproj", "{227874FB-6C92-4865-B43F-9FBD6C36BC4B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MLS.HumanizerRunner", "MLS.HumanizerRunner\MLS.HumanizerRunner.csproj", "{1020AE11-EBBE-41B5-9621-A804F1754154}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PackageTool.Tests", "PackageTool.Tests\PackageTool.Tests.csproj", "{11FDD0E8-D07B-41C9-AF7E-E7F735D91ECF}" EndProject Global @@ -137,10 +135,6 @@ Global {227874FB-6C92-4865-B43F-9FBD6C36BC4B}.Debug|Any CPU.Build.0 = Debug|Any CPU {227874FB-6C92-4865-B43F-9FBD6C36BC4B}.Release|Any CPU.ActiveCfg = Release|Any CPU {227874FB-6C92-4865-B43F-9FBD6C36BC4B}.Release|Any CPU.Build.0 = Release|Any CPU - {1020AE11-EBBE-41B5-9621-A804F1754154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1020AE11-EBBE-41B5-9621-A804F1754154}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1020AE11-EBBE-41B5-9621-A804F1754154}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1020AE11-EBBE-41B5-9621-A804F1754154}.Release|Any CPU.Build.0 = Release|Any CPU {11FDD0E8-D07B-41C9-AF7E-E7F735D91ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {11FDD0E8-D07B-41C9-AF7E-E7F735D91ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU {11FDD0E8-D07B-41C9-AF7E-E7F735D91ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -170,7 +164,6 @@ Global {F2FEA069-3121-4AB3-8835-F4EF6FCBFA18} = {8192FEAD-BCE6-4E62-97E5-2E9EA884BD71} {7EAD5482-90CC-4252-AF91-553A4B81D8E0} = {6EE8F484-DFA2-4F0F-939F-400CE78DFAC2} {227874FB-6C92-4865-B43F-9FBD6C36BC4B} = {6EE8F484-DFA2-4F0F-939F-400CE78DFAC2} - {1020AE11-EBBE-41B5-9621-A804F1754154} = {6EE8F484-DFA2-4F0F-939F-400CE78DFAC2} {11FDD0E8-D07B-41C9-AF7E-E7F735D91ECF} = {8192FEAD-BCE6-4E62-97E5-2E9EA884BD71} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/MLS.Agent/MLS.Agent.csproj b/MLS.Agent/MLS.Agent.csproj index a1c181ae0..c7a0e019e 100644 --- a/MLS.Agent/MLS.Agent.csproj +++ b/MLS.Agent/MLS.Agent.csproj @@ -110,7 +110,6 @@ - @@ -127,10 +126,7 @@ - + <_TryDotNetCssExists Condition="Exists('$(MSBuildThisFileDirectory)wwwroot\css\trydotnet.css')">true @@ -156,9 +152,7 @@ - + diff --git a/MLS.Blazor/global.json b/MLS.Blazor/global.json new file mode 100644 index 000000000..be6957e82 --- /dev/null +++ b/MLS.Blazor/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "2.1.503" + } +} \ No newline at end of file diff --git a/MLS.HumanizerRunner/App.cshtml b/MLS.HumanizerRunner/App.cshtml deleted file mode 100644 index 59be8326e..000000000 --- a/MLS.HumanizerRunner/App.cshtml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/MLS.HumanizerRunner/Linker.xml b/MLS.HumanizerRunner/Linker.xml deleted file mode 100644 index 8f42e5e94..000000000 --- a/MLS.HumanizerRunner/Linker.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MLS.HumanizerRunner/MLS.HumanizerRunner.csproj b/MLS.HumanizerRunner/MLS.HumanizerRunner.csproj deleted file mode 100644 index fb6ffbb93..000000000 --- a/MLS.HumanizerRunner/MLS.HumanizerRunner.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - netstandard2.0 - dotnet - blazor serve - 7.3 - MLS.HumanizerRunner - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MLS.HumanizerRunner/Pages/Index.cshtml b/MLS.HumanizerRunner/Pages/Index.cshtml deleted file mode 100644 index 5361047b3..000000000 --- a/MLS.HumanizerRunner/Pages/Index.cshtml +++ /dev/null @@ -1,4 +0,0 @@ - -@page "/" -@inherits IndexModel - diff --git a/MLS.HumanizerRunner/Pages/Index.cshtml.cs b/MLS.HumanizerRunner/Pages/Index.cshtml.cs deleted file mode 100644 index ce4bfbfb9..000000000 --- a/MLS.HumanizerRunner/Pages/Index.cshtml.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Blazor.Components; -using Microsoft.JSInterop; -using Newtonsoft.Json.Linq; -using MLS.WasmCodeRunner; - -namespace MLS.HumanizerRunner.Pages -{ - public class IndexModel : BlazorComponent - { - public IndexModel() - { - } - - protected override void OnAfterRender() - { - base.OnAfterRender(); - - PostMessage(JObject.FromObject(new { ready = true }).ToString()); - } - - public static Task PostMessage(string message) - { - // Implemented in interop.js - return JSRuntime.Current.InvokeAsync( - "BlazorInterop.postMessage", - message); - } - - [JSInvokable] - public static async Task PostMessageAsync(string message) - { - try - { - var result = CodeRunner.ProcessRunRequest(message); - if (result != null) - { - await PostMessage(JObject.FromObject(result).ToString()); - } - } - catch - { - } - - return true; - } - } -} \ No newline at end of file diff --git a/MLS.HumanizerRunner/Program.cs b/MLS.HumanizerRunner/Program.cs deleted file mode 100644 index f5f1a9f63..000000000 --- a/MLS.HumanizerRunner/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.AspNetCore.Blazor.Hosting; -using System.ComponentModel; - -namespace MLS.HumanizerRunner -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => - BlazorWebAssemblyHost.CreateDefaultBuilder() - .UseBlazorStartup(); - } -} diff --git a/MLS.HumanizerRunner/Properties/launchSettings.json b/MLS.HumanizerRunner/Properties/launchSettings.json deleted file mode 100644 index 6dddd2372..000000000 --- a/MLS.HumanizerRunner/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:62311/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "MLS.Blazor": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:62312/" - } - } -} \ No newline at end of file diff --git a/MLS.HumanizerRunner/Startup.cs b/MLS.HumanizerRunner/Startup.cs deleted file mode 100644 index e581921cc..000000000 --- a/MLS.HumanizerRunner/Startup.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.AspNetCore.Blazor.Builder; -using Microsoft.Extensions.DependencyInjection; -using System.ComponentModel; - -namespace MLS.HumanizerRunner -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - } - - public void Configure(IBlazorApplicationBuilder app) - { - app.AddComponent("app"); - } - } -} diff --git a/MLS.HumanizerRunner/wwwroot/index.html b/MLS.HumanizerRunner/wwwroot/index.html deleted file mode 100644 index a2b3dfe87..000000000 --- a/MLS.HumanizerRunner/wwwroot/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - Loading... - - - - - diff --git a/MLS.HumanizerRunner/wwwroot/interop.js b/MLS.HumanizerRunner/wwwroot/interop.js deleted file mode 100644 index 5cdb912f7..000000000 --- a/MLS.HumanizerRunner/wwwroot/interop.js +++ /dev/null @@ -1,13 +0,0 @@ -window.BlazorInterop = { - postMessage: function (message) { - - //console.log("interop posting message: ", message); - window.postMessage(message, "*"); - } -}; - - -window.addEventListener("message", e => { - //console.log("Interop js received: ", e); - DotNet.invokeMethodAsync("MLS.HumanizerRunner", "PostMessageAsync", e.data); -}); \ No newline at end of file From 390a1e7b52c68e7946b615043c23e47d438d0317 Mon Sep 17 00:00:00 2001 From: Akshita Date: Wed, 22 May 2019 13:20:08 -0700 Subject: [PATCH 2/4] remove humanizer references --- MLS.Agent.Tests/ApiViaHttpTests.cs | 13 ------------- MLS.Agent/Startup.cs | 7 ------- WorkspaceServer/PackageRegistry.cs | 8 -------- eng/Signing.props | 2 -- 4 files changed, 30 deletions(-) diff --git a/MLS.Agent.Tests/ApiViaHttpTests.cs b/MLS.Agent.Tests/ApiViaHttpTests.cs index 3d4ac12f6..1fc5364c1 100644 --- a/MLS.Agent.Tests/ApiViaHttpTests.cs +++ b/MLS.Agent.Tests/ApiViaHttpTests.cs @@ -802,19 +802,6 @@ public async Task Can_serve_blazor_console_code_runner() result.Should().Contain("Loading..."); } } - - [Fact] - public async Task Can_serve_humanizer_code_runner() - { - using (var agent = new AgentService()) - { - var response = await agent.GetAsync(@"/LocalCodeRunner/humanizer.api"); - - response.EnsureSuccess(); - var result = await response.Content.ReadAsStringAsync(); - result.Should().Contain("Loading..."); - } - } [Fact] public async Task Can_serve_nodatime_code_runner() diff --git a/MLS.Agent/Startup.cs b/MLS.Agent/Startup.cs index 66bba139f..ece32cbd2 100644 --- a/MLS.Agent/Startup.cs +++ b/MLS.Agent/Startup.cs @@ -170,13 +170,6 @@ public void Configure( builder.UseBlazor(); }); - app.Map("/LocalCodeRunner/humanizer.api", builder => - { - builder.UsePathBase("/LocalCodeRunner/humanizer/"); - builder.EnableCachingBlazorContent(); - builder.UseBlazor(); - }); - var budget = new Budget(); _disposables.Add(() => budget.Cancel()); BlazorPackageConfiguration.Configure(app, app.ApplicationServices, packageRegistry, budget, !StartupOptions.IsLanguageService); diff --git a/WorkspaceServer/PackageRegistry.cs b/WorkspaceServer/PackageRegistry.cs index 8ba301ffa..f6b578540 100644 --- a/WorkspaceServer/PackageRegistry.cs +++ b/WorkspaceServer/PackageRegistry.cs @@ -199,14 +199,6 @@ public static PackageRegistry CreateForHostedMode() packageBuilder.AddPackageReference("Newtonsoft.Json"); }); - registry.Add("humanizer.api", - packageBuilder => - { - packageBuilder.CreateUsingDotnet("classlib"); - packageBuilder.AddPackageReference("Newtonsoft.Json"); - packageBuilder.AddPackageReference("Humanizer"); - }); - // Todo: soemething about nodatime 2.3 makes blazor toolchain fail to build registry.Add("blazor-nodatime.api", packageBuilder => diff --git a/eng/Signing.props b/eng/Signing.props index 68b5ac900..2f592e2db 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -27,8 +27,6 @@ - - From 3e34062efdf5a215c2c92df80f998d2b2b6d3934 Mon Sep 17 00:00:00 2001 From: Akshita Date: Wed, 22 May 2019 14:09:38 -0700 Subject: [PATCH 3/4] Add the sdk version --- MLS.Blazor/global.json | 5 ----- global.json | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 MLS.Blazor/global.json diff --git a/MLS.Blazor/global.json b/MLS.Blazor/global.json deleted file mode 100644 index be6957e82..000000000 --- a/MLS.Blazor/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "2.1.503" - } -} \ No newline at end of file diff --git a/global.json b/global.json index 302ea296a..c8a30f359 100644 --- a/global.json +++ b/global.json @@ -4,5 +4,8 @@ }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19257.7" + }, + "sdk": { + "version": "2.1.503" } } From a051217fb3c602614691b9c50ce0bc923575b273 Mon Sep 17 00:00:00 2001 From: Akshita Date: Wed, 22 May 2019 15:35:29 -0700 Subject: [PATCH 4/4] remove the sdk --- global.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/global.json b/global.json index c8a30f359..302ea296a 100644 --- a/global.json +++ b/global.json @@ -4,8 +4,5 @@ }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19257.7" - }, - "sdk": { - "version": "2.1.503" } }