Skip to content

Commit

Permalink
fix(TagManager): fix issue with using dynamic script in nugget
Browse files Browse the repository at this point in the history
  • Loading branch information
bkapustik committed Mar 20, 2024
1 parent fcc2348 commit ed22dd1
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 139 deletions.
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
Expand Down
97 changes: 54 additions & 43 deletions examples/DancingGoat/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"dependencies": {
"net8.0": {
"net6.0": {
"Kentico.Xperience.Admin": {
"type": "Direct",
"requested": "[28.3.1, )",
Expand Down Expand Up @@ -164,8 +164,8 @@
"resolved": "13.8.1",
"contentHash": "KgsJ88vcX0UfSKAO7uzbEPOGu8wwJU3Vkgz7AgeTrnfdgIVjZFkesvMxDqjzY6F3fmMbJmfAOLjufYLFs1Fq1g==",
"dependencies": {
"Microsoft.Extensions.ObjectPool": "8.0.0",
"System.Diagnostics.DiagnosticSource": "8.0.0",
"Microsoft.Extensions.ObjectPool": "6.0.0",
"System.Diagnostics.DiagnosticSource": "6.0.0",
"System.Threading.Tasks.Extensions": "4.5.0"
}
},
Expand All @@ -190,7 +190,8 @@
"contentHash": "+llX8ziARzp+aKsOaXQfZAtqE+lF8gSmTiMiRCdpf03M+IWl/uCD9965nhqkM4mauWufwBXlwA7TE4uIUu+UjQ==",
"dependencies": {
"HotChocolate.Language": "13.8.1",
"System.Collections.Immutable": "8.0.0"
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"System.Collections.Immutable": "6.0.0"
}
},
"HotChocolate.AspNetCore": {
Expand Down Expand Up @@ -234,8 +235,8 @@
"HotChocolate.Types": "13.8.1",
"HotChocolate.Utilities.DependencyInjection": "13.8.1",
"HotChocolate.Validation": "13.8.1",
"Microsoft.Extensions.DependencyInjection": "8.0.0",
"System.Threading.Channels": "8.0.0"
"Microsoft.Extensions.DependencyInjection": "6.0.0",
"System.Threading.Channels": "6.0.0"
}
},
"HotChocolate.Execution.Abstractions": {
Expand All @@ -244,7 +245,7 @@
"contentHash": "sAL6A/Qa23inTgu8sWiNoaKpaJ3MosXLsiP908+XUogMOjudpWnaSWPYu5THgl1deaQ6q55gbyiFvwJx5lRR8A==",
"dependencies": {
"HotChocolate.Abstractions": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0"
}
},
"HotChocolate.Fetching": {
Expand Down Expand Up @@ -272,7 +273,7 @@
"resolved": "13.8.1",
"contentHash": "0RYVxhsxR1vf0ue/V8GZnN8UVxh1bI74KPe0vFLLlNXRSq55LXTuGt3gYc6+LxSCc4KaItzRl6DwdgRuDRINjw==",
"dependencies": {
"Microsoft.Extensions.ObjectPool": "8.0.0"
"Microsoft.Extensions.ObjectPool": "6.0.0"
}
},
"HotChocolate.Language.Utf8": {
Expand Down Expand Up @@ -315,15 +316,15 @@
"dependencies": {
"HotChocolate.Execution.Abstractions": "13.8.1",
"HotChocolate.Subscriptions": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0"
}
},
"HotChocolate.Transport.Sockets": {
"type": "Transitive",
"resolved": "13.8.1",
"contentHash": "YVfn1O+B0UlGKtieqRoGEeZjnFpSNjK1ZQVLvfKZ/DfCh+7FR9CwZ6II7YXWCE+M9sCQTvEo9Cz5XCpsnJDhIw==",
"dependencies": {
"System.IO.Pipelines": "8.0.0"
"System.IO.Pipelines": "6.0.0"
}
},
"HotChocolate.Types": {
Expand All @@ -334,10 +335,10 @@
"HotChocolate.Abstractions": "13.8.1",
"HotChocolate.Types.Shared": "13.8.1",
"HotChocolate.Utilities": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.ObjectPool": "8.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.ObjectPool": "6.0.0",
"System.ComponentModel.Annotations": "5.0.0",
"System.Text.Json": "8.0.0"
"System.Text.Json": "6.0.7"
}
},
"HotChocolate.Types.CursorPagination": {
Expand Down Expand Up @@ -393,7 +394,7 @@
"resolved": "13.8.1",
"contentHash": "4tEg4xfDfiahuLrC59gH+BYfAFqDPEvoyBK7PU3ep7O2cmQgnqeE3tKMqJ1UovGMsVQ5nYwcQ98LhqrPOxECUw==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "8.0.0"
"Microsoft.Extensions.DependencyInjection": "6.0.0"
}
},
"HotChocolate.Validation": {
Expand All @@ -402,8 +403,8 @@
"contentHash": "kmPmYrtCt1NtmyZiSvfjDU+Abc/4hI2wDLe1uDEZW8JC8O2uwH0becZm1K6j9ZUfVMLp/5ZNsQONOXzL1VwxLA==",
"dependencies": {
"HotChocolate.Types": "13.8.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Options": "8.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0"
}
},
"HtmlSanitizer": {
Expand Down Expand Up @@ -675,16 +676,16 @@
},
"Microsoft.Extensions.ObjectPool": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "4pm+XgxSukskwjzDDfSjG4KNUIOdFF2VaqZZDtTzoyQMOVSnlV6ZM8a9aVu5dg9LVZTB//utzSc8fOi0b0Mb2Q=="
"resolved": "6.0.0",
"contentHash": "7hR9FU0JJHOCLmn/Ary31pLLAhlzoMptBKs5CJmNUzD87dXjl+/NqVkyCTl6cT2JAfTK0G39HpvCOv1fhsX3BQ=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==",
"resolved": "6.0.0",
"contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Primitives": "8.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Primitives": "6.0.0"
}
},
"Microsoft.Extensions.Options.ConfigurationExtensions": {
Expand All @@ -701,8 +702,11 @@
},
"Microsoft.Extensions.Primitives": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
"resolved": "6.0.0",
"contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"Microsoft.Identity.Client": {
"type": "Transitive",
Expand Down Expand Up @@ -840,7 +844,10 @@
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg=="
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.ComponentModel.Annotations": {
"type": "Transitive",
Expand All @@ -852,19 +859,16 @@
"resolved": "8.0.0",
"contentHash": "JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==",
"dependencies": {
"System.Diagnostics.EventLog": "8.0.0",
"System.Security.Cryptography.ProtectedData": "8.0.0"
}
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "c9xLpVz6PL9lp/djOWtk5KPDZq3cSYpmXoJQY524EOtuFl5z9ZtsotpsyrDW40U1DRnQSYvcPKEUV0X//u6gkQ=="
},
"System.Diagnostics.EventLog": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A=="
"resolved": "6.0.1",
"contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Formats.Asn1": {
"type": "Transitive",
Expand Down Expand Up @@ -896,8 +900,8 @@
},
"System.IO.Pipelines": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA=="
"resolved": "6.0.0",
"contentHash": "mXX66shZ4xLlI3vNLaJ0lt8OIZdmXTvIqXRdQX5HLVGSkLhINLsVhyZuX2UdRFnOGkqnwmMUs40pIIQ7mna4+A=="
},
"System.Memory": {
"type": "Transitive",
Expand Down Expand Up @@ -969,25 +973,32 @@
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ=="
"contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==",
"resolved": "6.0.7",
"contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==",
"dependencies": {
"System.Text.Encodings.Web": "8.0.0"
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
}
},
"System.Threading.Channels": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA=="
"resolved": "6.0.0",
"contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q=="
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const isProduction = process.env.NODE_ENV == "production";
const config = {
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, "../.././wwwroot/scripts"),
path: path.resolve(__dirname, "../.././wwwroot/js"),
filename: "ktc-tagmanager.js",
module: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<ItemGroup>
<Folder Include="Admin\Client\dist\" />
<Folder Include="wwwroot\Scripts\" />
<Folder Include="wwwroot\js\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private IHtmlContent GetScriptSrcTag()
["type"] = "module",
["src"] = fileVersionProvider.AddFileVersionToPath(
ViewContext.HttpContext.Request.PathBase,
urlHelper.Content("~/_content/Kentico.Xperience.TagManager/Scripts/ktc-tagmanager.js"))
urlHelper.Content("./_content/Kentico.Xperience.TagManager/js/ktc-tagmanager.js"))
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ namespace Kentico.Xperience.TagManager.Rendering;

[ApiController]
[Route("/kentico.tagmanager/[action]")]
public sealed class TagManagerController(IChannelCodeSnippetsService channelCodeSnippetsContext) : Controller
public sealed class TagManagerController : Controller
{
private readonly IChannelCodeSnippetsService channelCodeSnippetsContext = channelCodeSnippetsContext;
private readonly IChannelCodeSnippetsService channelCodeSnippetsContext;

public TagManagerController(IChannelCodeSnippetsService channelCodeSnippetsContext) => this.channelCodeSnippetsContext = channelCodeSnippetsContext;

private static readonly JsonSerializerOptions jsonSerializerOptions = new()
{
Expand Down
Loading

0 comments on commit ed22dd1

Please sign in to comment.