From c82f0822802dc612f6cf0e3b98f1cbfc92ee3636 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sat, 31 Mar 2018 20:31:02 -0400 Subject: [PATCH 1/5] convert to csproj --- TurboLinks.Net.sln | 14 +- global.json | 6 - src/TurboLinks.Net/Properties/AssemblyInfo.cs | 7 +- src/TurboLinks.Net/TurboLinks.Net.csproj | 19 ++ src/TurboLinks.Net/TurboLinks.Net.xproj | 20 -- src/TurboLinks.Net/project.json | 22 --- src/TurboLinksExample/Project_Readme.html | 187 ------------------ .../TurboLinksExample.csproj | 48 +++++ src/TurboLinksExample/TurboLinksExample.xproj | 23 --- src/TurboLinksExample/project.json | 66 ------- 10 files changed, 75 insertions(+), 337 deletions(-) delete mode 100644 global.json create mode 100644 src/TurboLinks.Net/TurboLinks.Net.csproj delete mode 100644 src/TurboLinks.Net/TurboLinks.Net.xproj delete mode 100644 src/TurboLinks.Net/project.json delete mode 100644 src/TurboLinksExample/Project_Readme.html create mode 100644 src/TurboLinksExample/TurboLinksExample.csproj delete mode 100644 src/TurboLinksExample/TurboLinksExample.xproj delete mode 100644 src/TurboLinksExample/project.json diff --git a/TurboLinks.Net.sln b/TurboLinks.Net.sln index a9adb45..480732d 100644 --- a/TurboLinks.Net.sln +++ b/TurboLinks.Net.sln @@ -1,18 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D0D99B75-30C7-485A-B978-3008D6908B7B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40D6294D-197C-47C9-9C4F-26C0BAEF2A80}" - ProjectSection(SolutionItems) = preProject - global.json = global.json - EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TurboLinks.Net", "src\TurboLinks.Net\TurboLinks.Net.xproj", "{54979581-020C-4F8B-99B0-36C28FFBBADE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TurboLinks.Net", "src\TurboLinks.Net\TurboLinks.Net.csproj", "{54979581-020C-4F8B-99B0-36C28FFBBADE}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TurboLinksExample", "src\TurboLinksExample\TurboLinksExample.xproj", "{16DC6FE0-A511-45E0-BD49-28933EAD8A98}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TurboLinksExample", "src\TurboLinksExample\TurboLinksExample.csproj", "{16DC6FE0-A511-45E0-BD49-28933EAD8A98}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -36,4 +33,7 @@ Global {54979581-020C-4F8B-99B0-36C28FFBBADE} = {D0D99B75-30C7-485A-B978-3008D6908B7B} {16DC6FE0-A511-45E0-BD49-28933EAD8A98} = {D0D99B75-30C7-485A-B978-3008D6908B7B} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BBAAEACA-BCBF-4EE8-BECF-BA22FAE2BFC7} + EndGlobalSection EndGlobal diff --git a/global.json b/global.json deleted file mode 100644 index 0ac230b..0000000 --- a/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "projects": [ "src", "test" ], - "sdk": { - "version": "1.0.0-preview2-003131" - } -} diff --git a/src/TurboLinks.Net/Properties/AssemblyInfo.cs b/src/TurboLinks.Net/Properties/AssemblyInfo.cs index 8deef2b..14a3918 100644 --- a/src/TurboLinks.Net/Properties/AssemblyInfo.cs +++ b/src/TurboLinks.Net/Properties/AssemblyInfo.cs @@ -5,12 +5,7 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TurboLinks.Net")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TurboLinks.Net")] -[assembly: AssemblyCopyright("Copyright © 2016")] + [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/TurboLinks.Net/TurboLinks.Net.csproj b/src/TurboLinks.Net/TurboLinks.Net.csproj new file mode 100644 index 0000000..c753db0 --- /dev/null +++ b/src/TurboLinks.Net/TurboLinks.Net.csproj @@ -0,0 +1,19 @@ + + + + Add support for Turbolinks + Tommy Parnell + netstandard1.6 + TurboLinks.Net + TurboLinks.Net + TurboLinks Middlewear + https://github.com/terribledev/TurboLinks.Net + https://opensource.org/licenses/MIT + + + + + + + + diff --git a/src/TurboLinks.Net/TurboLinks.Net.xproj b/src/TurboLinks.Net/TurboLinks.Net.xproj deleted file mode 100644 index 02ea6c9..0000000 --- a/src/TurboLinks.Net/TurboLinks.Net.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - 54979581-020c-4f8b-99b0-36c28ffbbade - TurboLinks.Net - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - - 2.0 - - - diff --git a/src/TurboLinks.Net/project.json b/src/TurboLinks.Net/project.json deleted file mode 100644 index ce76ffe..0000000 --- a/src/TurboLinks.Net/project.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": "1.1.1", - "description": "Add support for Turbolinks", - "authors": [ "Tommy Parnell" ], - "packOptions": { - "tags": [ "TurboLinks Middlewear" ], - "projectUrl": "https://github.com/tparnell8/TurboLinks.Net", - "licenseUrl": "https://opensource.org/licenses/MIT" - }, - "dependencies": { - "NETStandard.Library": "1.6.0", - "Microsoft.AspNetCore.Http.Abstractions": "1.0.0", - "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0" - }, - - "frameworks": { - "netstandard1.6": { - "imports": "dnxcore50" - } - } -} \ No newline at end of file diff --git a/src/TurboLinksExample/Project_Readme.html b/src/TurboLinksExample/Project_Readme.html deleted file mode 100644 index 1a0f5b5..0000000 --- a/src/TurboLinksExample/Project_Readme.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Welcome to ASP.NET Core - - - - - - -
-
-

This application consists of:

-
    -
  • Sample pages using ASP.NET Core MVC
  • -
  • Bower for managing client-side libraries
  • -
  • Theming using Bootstrap
  • -
-
- - - - - -
- - - diff --git a/src/TurboLinksExample/TurboLinksExample.csproj b/src/TurboLinksExample/TurboLinksExample.csproj new file mode 100644 index 0000000..5d17d4e --- /dev/null +++ b/src/TurboLinksExample/TurboLinksExample.csproj @@ -0,0 +1,48 @@ + + + + netcoreapp1.0 + true + TurboLinksExample + Exe + TurboLinksExample + 1.0.4 + $(PackageTargetFallback);dotnet5.6;portable-net45+win8 + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/TurboLinksExample/TurboLinksExample.xproj b/src/TurboLinksExample/TurboLinksExample.xproj deleted file mode 100644 index 6d1aa27..0000000 --- a/src/TurboLinksExample/TurboLinksExample.xproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 16dc6fe0-a511-45e0-bd49-28933ead8a98 - TurboLinksExample - .\obj - .\bin\ - v4.5.2 - - - 2.0 - - - - - - - diff --git a/src/TurboLinksExample/project.json b/src/TurboLinksExample/project.json deleted file mode 100644 index faf7152..0000000 --- a/src/TurboLinksExample/project.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.1", - "type": "platform" - }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.1", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Routing": "1.0.1", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", - "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", - "TurboLinks.Net": "1.1.1" - }, - - "tools": { - "BundlerMinifier.Core": "2.0.238", - "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", - "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "wwwroot", - "**/*.cshtml", - "appsettings.json", - "web.config" - ] - }, - - "scripts": { - "prepublish": [ "bower install", "dotnet bundle" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - } -} From 6cb51993624d187d2576570473ca8a79291b88ae Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 4 Nov 2018 08:27:11 -0500 Subject: [PATCH 2/5] update to 2.1 --- src/TurboLinks.Net/TurboLinks.Net.csproj | 6 ++--- src/TurboLinks.Net/TurboLinks.cs | 12 ++++------ src/TurboLinksExample/Startup.cs | 1 - .../TurboLinksExample.csproj | 24 ++----------------- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/TurboLinks.Net/TurboLinks.Net.csproj b/src/TurboLinks.Net/TurboLinks.Net.csproj index c753db0..09b6918 100644 --- a/src/TurboLinks.Net/TurboLinks.Net.csproj +++ b/src/TurboLinks.Net/TurboLinks.Net.csproj @@ -3,7 +3,7 @@ Add support for Turbolinks Tommy Parnell - netstandard1.6 + netstandard2.0 TurboLinks.Net TurboLinks.Net TurboLinks Middlewear @@ -12,8 +12,8 @@ - - + + diff --git a/src/TurboLinks.Net/TurboLinks.cs b/src/TurboLinks.Net/TurboLinks.cs index b0129e3..6b27387 100644 --- a/src/TurboLinks.Net/TurboLinks.cs +++ b/src/TurboLinks.Net/TurboLinks.cs @@ -24,13 +24,13 @@ namespace TurboLinks.Net var request = context.Request; var response = context.Response; - if(!string.IsNullOrWhiteSpace(request.Headers["X-XHR-Referer"])) + if (!string.IsNullOrWhiteSpace(request.Headers["X-XHR-Referer"])) { context.Response.Cookies.Append("request_method", request.Method, new CookieOptions { HttpOnly = false }); - if(context.Response.StatusCode == 301 || context.Response.StatusCode == 302) + if (context.Response.StatusCode == 301 || context.Response.StatusCode == 302) { var uri = new Uri(response.Headers["Location"]); - if(uri.Host.Equals(request.Host.Value)) + if (uri.Host.Equals(request.Host.Value)) { response.Headers["X-XHR-Redirected-To"] = response.Headers["Location"]; } @@ -45,9 +45,7 @@ namespace TurboLinks.Net public static class BuilderExtension { - public static void UseTurboLinks(this IApplicationBuilder app) - { - app.UseMiddleware(); - } + public static IApplicationBuilder UseTurboLinks(this IApplicationBuilder app) => app.UseMiddleware(); + } } \ No newline at end of file diff --git a/src/TurboLinksExample/Startup.cs b/src/TurboLinksExample/Startup.cs index 71295a2..803b96f 100644 --- a/src/TurboLinksExample/Startup.cs +++ b/src/TurboLinksExample/Startup.cs @@ -40,7 +40,6 @@ namespace TurboLinksExample if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - app.UseBrowserLink(); } else { diff --git a/src/TurboLinksExample/TurboLinksExample.csproj b/src/TurboLinksExample/TurboLinksExample.csproj index 5d17d4e..6c5ee6f 100644 --- a/src/TurboLinksExample/TurboLinksExample.csproj +++ b/src/TurboLinksExample/TurboLinksExample.csproj @@ -1,13 +1,9 @@ - netcoreapp1.0 + netcoreapp2.1 true TurboLinksExample - Exe - TurboLinksExample - 1.0.4 - $(PackageTargetFallback);dotnet5.6;portable-net45+win8 @@ -21,19 +17,7 @@ - - - - - - - - - - - - - + @@ -41,8 +25,4 @@ - - - - From 2561abd4187e21c17a3b49f834ebb2f36e54285c Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 4 Nov 2018 08:30:24 -0500 Subject: [PATCH 3/5] fix up readme --- Readme.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 3cadddc..77a2605 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ [![Build status](https://ci.appveyor.com/api/projects/status/ns9koh6l7l1nuv57?svg=true)](https://ci.appveyor.com/project/tparnell8/turbolinks-net) -Add [turbolink](https://github.com/rails/turbolinks) support to ~~ASP.NET 5~~ ASP.NET Core 1.0 applications +Add [turbolink](https://github.com/rails/turbolinks) ASP.NET core 2.1 applications This provides middlewear to add support for turbolinks. @@ -12,7 +12,3 @@ If you have an application that may not fit into an SPA, or just have a lot of c **Warning** This stops page loads thus `$(document).ready(function(){})` does not fire on new pages. - -## What about asp.net 4x? - -I am going to back port this to owin, and eventually more classic version of ASP.NET In the mean time, you can find an MVC action filter [here](https://github.com/kazimanzurrashid/aspnetmvcturbolinks) From 4db781a0404052c3328909f81c94983ec4cee3df Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 4 Nov 2018 08:38:37 -0500 Subject: [PATCH 4/5] fix up build --- appveyor.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2a147f9..cfa2ef6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,20 +1,23 @@ -configuration: Release -version: 0.1.{build} -nuget: - account_feed: true - project_feed: true - -init: - - git config --global core.autocrlf true - -before_build: -- ps: invoke-webrequest https://go.microsoft.com/fwlink/?LinkID=827524 -OutFile core.exe -- ps: .\core.exe /install /quiet /norestart -- ps: dotnet restore +image: Visual Studio 2017 +version: 1.0.{build} build_script: -- ps: dotnet build .\src\TurboLinks.Net -- ps: dotnet build .\src\TurboLinksExample - +- ps: >- + dotnet restore TurboLinks.Net.sln --source https://api.nuget.org/v3/index.json + dotnet build TurboLinks.Net.sln + if($env:APPVEYOR_REPO_TAG -eq "true") + { + dotnet pack src\TurboLinks.Net\TurboLinks.Net.csproj --configuration Release --output ..\..\output /p:Version=$env:APPVEYOR_REPO_TAG_NAME + } + else + { + dotnet pack src\TurboLinks.Net\TurboLinks.Net.csproj --configuration Release --output ..\..\output /p:Version=0.0.1-build-$env:APPVEYOR_BUILD_NUMBER + } artifacts: - - path: artifacts\bin\TurboLinks.Net\Release\*.nupkg \ No newline at end of file +- path: output\**.nupkg +deploy: +- provider: NuGet + api_key: + secure: //tKHlb2yqAtpxnR6p9IAtXwQNaq8UYYyIFSD0QVF3XnEasIxG2gTWdmWuG87fUX + on: + appveyor_repo_tag: true \ No newline at end of file From 167b15f015b71c9e8e55a20a542b2a4e6f54865b Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 4 Nov 2018 08:49:51 -0500 Subject: [PATCH 5/5] source link --- src/TurboLinks.Net/TurboLinks.Net.csproj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TurboLinks.Net/TurboLinks.Net.csproj b/src/TurboLinks.Net/TurboLinks.Net.csproj index 09b6918..6560e8d 100644 --- a/src/TurboLinks.Net/TurboLinks.Net.csproj +++ b/src/TurboLinks.Net/TurboLinks.Net.csproj @@ -9,11 +9,22 @@ TurboLinks Middlewear https://github.com/terribledev/TurboLinks.Net https://opensource.org/licenses/MIT + GitHub + + + $(TargetsForTfmSpecificContentInPackage);IncludePDBsInPackage + + + + + + +