From 4c31931851665db00ae3c02d2794daf37d5cf753 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 5 Jan 2022 21:43:24 +0100 Subject: [PATCH] Fixes and simplified the angular integration. (#822) * Fixes and simplified the angular integration. * More fixes. --- .../Squidex.Web/Pipeline/CachingManager.cs | 2 +- .../Frontend/Middlewares/IndexExtensions.cs | 56 ++-- .../Frontend/Middlewares/IndexMiddleware.cs | 57 ---- .../Frontend/Middlewares/WebpackMiddleware.cs | 61 ---- backend/src/Squidex/Areas/Frontend/Startup.cs | 85 +++--- .../Config/DynamicApplicationStore.cs | 4 +- .../Controllers/Setup/SetupController.cs | 7 - .../IdentityServer/Views/Setup/Webpack.cshtml | 75 ----- .../Areas/IdentityServer/Views/_Layout.cshtml | 11 +- backend/src/Squidex/Squidex.csproj | 13 +- backend/src/Squidex/Startup.cs | 1 - backend/src/Squidex/web.config | 15 +- .../wwwroot/client-callback-popup.html | 2 +- .../wwwroot/client-callback-silent.html | 2 +- frontend/.eslintrc.js | 12 +- frontend/app-config/helpers.js | 18 ++ frontend/app-config/webpack.config.js | 275 ++++++++---------- frontend/app/index.html | 7 +- frontend/app/shared/services/auth.service.ts | 4 +- frontend/package-lock.json | 193 ++++++++++-- frontend/package.json | 5 +- 21 files changed, 412 insertions(+), 493 deletions(-) delete mode 100644 backend/src/Squidex/Areas/Frontend/Middlewares/IndexMiddleware.cs delete mode 100644 backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs delete mode 100644 backend/src/Squidex/Areas/IdentityServer/Views/Setup/Webpack.cshtml create mode 100644 frontend/app-config/helpers.js diff --git a/backend/src/Squidex.Web/Pipeline/CachingManager.cs b/backend/src/Squidex.Web/Pipeline/CachingManager.cs index 2572c48ab..bd17a759c 100644 --- a/backend/src/Squidex.Web/Pipeline/CachingManager.cs +++ b/backend/src/Squidex.Web/Pipeline/CachingManager.cs @@ -146,7 +146,7 @@ namespace Squidex.Web.Pipeline if (headers.Count > 0) { - response.Headers.Add(HeaderNames.Vary, new StringValues(headers.ToArray())); + response.Headers[HeaderNames.Vary] = new StringValues(headers.ToArray()); } } diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs index 6093abc4d..f4c8dface 100644 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs +++ b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs @@ -9,9 +9,11 @@ using System.Collections.Concurrent; using System.Globalization; using System.Net; using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; using Squidex.Areas.Api.Controllers.UI; using Squidex.Domain.Apps.Entities.History; -using Squidex.Infrastructure.Json; using Squidex.Web; namespace Squidex.Areas.Frontend.Middlewares @@ -19,64 +21,52 @@ namespace Squidex.Areas.Frontend.Middlewares public static class IndexExtensions { private static readonly ConcurrentDictionary Texts = new ConcurrentDictionary(); - - public static bool IsIndex(this HttpContext context) - { - var path = context.Request.Path.Value; - - return path == "/" || path?.EndsWith("/index.html", StringComparison.OrdinalIgnoreCase) == true; - } - - public static bool IsHtmlPath(this HttpContext context) + private static readonly JsonSerializer JsonSerializer = JsonSerializer.CreateDefault(new JsonSerializerSettings { - return context.Request.Path.Value?.EndsWith(".html", StringComparison.OrdinalIgnoreCase) == true; - } + ContractResolver = new CamelCasePropertyNamesContractResolver() + }); - public static bool IsNotModified(this HttpResponse response) + public static bool IsIndex(this HttpContext context) { - return response.StatusCode == (int)HttpStatusCode.NotModified; + return context.Request.Path.StartsWithSegments("/index.html", StringComparison.OrdinalIgnoreCase); } - public static string AdjustBase(this string html, HttpContext httpContext) + public static string AddOptions(this string html, HttpContext httpContext) { - if (httpContext.Request.PathBase != null) + var scripts = new List { - html = html.Replace("", $"", StringComparison.OrdinalIgnoreCase); - } + $"var texts = {GetText(CultureInfo.CurrentUICulture.Name)};" + }; - return html; - } - - public static string AddOptions(this string html, HttpContext httpContext) - { var uiOptions = httpContext.RequestServices.GetService>()?.Value; if (uiOptions != null) { + var json = JObject.FromObject(uiOptions, JsonSerializer); + var values = httpContext.RequestServices.GetService(); if (values != null) { - uiOptions.More["info"] = values.ToString(); + json["more"] ??= new JObject(); + json["more"]!["info"] = values.ToString(); } - var notifo = httpContext.RequestServices!.GetRequiredService>(); + var notifo = httpContext.RequestServices!.GetService>(); - if (notifo.Value.IsConfigured()) + if (notifo?.Value.IsConfigured() == true) { - uiOptions.More["notifoApi"] = notifo.Value.ApiUrl; + json["more"] ??= new JObject(); + json["more"]!["notifoApi"] = notifo.Value.ApiUrl; } uiOptions.More["culture"] = CultureInfo.CurrentUICulture.Name; - var jsonSerializer = httpContext.RequestServices.GetRequiredService(); - var jsonOptions = jsonSerializer.Serialize(uiOptions, true); - - var texts = GetText(CultureInfo.CurrentUICulture.Name); - - html = html.Replace("", $"\n", StringComparison.OrdinalIgnoreCase); + scripts.Add($"var options = {json.ToString(Formatting.Indented)};"); } + html = html.Replace("", $"\n", StringComparison.OrdinalIgnoreCase); + return html; } diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexMiddleware.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexMiddleware.cs deleted file mode 100644 index 7a1359d32..000000000 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexMiddleware.cs +++ /dev/null @@ -1,57 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -using System.Text; - -namespace Squidex.Areas.Frontend.Middlewares -{ - public sealed class IndexMiddleware - { - private readonly RequestDelegate next; - - public IndexMiddleware(RequestDelegate next) - { - this.next = next; - } - - public async Task InvokeAsync(HttpContext context) - { - if (context.IsHtmlPath() && !context.Response.IsNotModified()) - { - var responseBuffer = new MemoryStream(); - var responseBody = context.Response.Body; - - context.Response.Body = responseBuffer; - - await next(context); - - if (!context.Response.IsNotModified()) - { - context.Response.Body = responseBody; - - var html = Encoding.UTF8.GetString(responseBuffer.ToArray()); - - html = html.AdjustBase(context); - - if (context.IsIndex()) - { - html = html.AddOptions(context); - } - - context.Response.ContentLength = Encoding.UTF8.GetByteCount(html); - context.Response.Body = responseBody; - - await context.Response.WriteAsync(html, context.RequestAborted); - } - } - else - { - await next(context); - } - } - } -} diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs deleted file mode 100644 index 709f97f05..000000000 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs +++ /dev/null @@ -1,61 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -namespace Squidex.Areas.Frontend.Middlewares -{ - public sealed class WebpackMiddleware - { - private const string WebpackUrl = "https://localhost:3000/index.html"; - - private readonly RequestDelegate next; - - public WebpackMiddleware(RequestDelegate next) - { - this.next = next; - } - - public async Task InvokeAsync(HttpContext context) - { - if (context.IsIndex() && !context.Response.IsNotModified()) - { - try - { - var handler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, error) => true - }; - - using (var client = new HttpClient(handler)) - { - var result = await client.GetAsync(WebpackUrl, context.RequestAborted); - - context.Response.StatusCode = (int)result.StatusCode; - - if (result.IsSuccessStatusCode) - { - var html = await result.Content.ReadAsStringAsync(context.RequestAborted); - - html = html.AdjustBase(context); - - await context.Response.WriteAsync(html, context.RequestAborted); - } - } - } - catch - { - context.Request.Path = "/identity-server/webpack"; - - await next(context); - } - } - else - { - await next(context); - } - } - } -} diff --git a/backend/src/Squidex/Areas/Frontend/Startup.cs b/backend/src/Squidex/Areas/Frontend/Startup.cs index fa03d66fc..466aa9856 100644 --- a/backend/src/Squidex/Areas/Frontend/Startup.cs +++ b/backend/src/Squidex/Areas/Frontend/Startup.cs @@ -5,8 +5,10 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using Microsoft.Extensions.FileProviders; using Microsoft.Net.Http.Headers; using Squidex.Areas.Frontend.Middlewares; +using Squidex.Hosting.Web; using Squidex.Pipeline.Squid; using Squidex.Web.Pipeline; @@ -18,74 +20,73 @@ namespace Squidex.Areas.Frontend { var environment = app.ApplicationServices.GetRequiredService(); - app.Map("/squid.svg", builder => builder.UseMiddleware()); + var fileProvider = environment.WebRootFileProvider; - app.UseMiddleware(); - - var indexFile = - environment.IsProduction() ? - new PathString("/build/index.html") : - new PathString("/index.html"); - - app.Use((context, next) => + if (environment.IsProduction()) { - if (context.Request.Path == "/client-callback-popup") - { - context.Request.Path = new PathString("/client-callback-popup.html"); - } - else if (context.Request.Path == "/client-callback-silent") - { - context.Request.Path = new PathString("/client-callback-silent.html"); - } - else if (!Path.HasExtension(context.Request.Path.Value)) + fileProvider = new CompositeFileProvider(fileProvider, + new PhysicalFileProvider(Path.Combine(environment.WebRootPath, "build"))); + + app.Use((context, next) => { - context.Request.Path = indexFile; - } + if (!Path.HasExtension(context.Request.Path.Value)) + { + context.Request.Path = new PathString("/index.html"); + } - return next(); + return next(); + }); + } + + app.Map("/squid.svg", builder => + { + builder.UseMiddleware(); }); - app.UseWhen(x => x.Request.Path.StartsWithSegments(indexFile, StringComparison.Ordinal), builder => + app.UseMiddleware(); + + app.UseWhen(x => x.IsIndex(), builder => { builder.UseMiddleware(); }); - app.UseMiddleware(); + app.UseHtmlTransform(new HtmlTransformOptions + { + Transform = (html, context) => + { + if (context.IsIndex()) + { + html = html.AddOptions(context); + } - app.ConfigureDev(); + return new ValueTask(html); + } + }); app.UseStaticFiles(new StaticFileOptions { OnPrepareResponse = context => { var response = context.Context.Response; - var responseHeaders = response.GetTypedHeaders(); - if (!string.Equals(response.ContentType, "text/html", StringComparison.OrdinalIgnoreCase)) + if (!string.IsNullOrWhiteSpace(context.Context.Request.QueryString.ToString())) { - responseHeaders.CacheControl = new CacheControlHeaderValue - { - MaxAge = TimeSpan.FromDays(60) - }; + response.Headers[HeaderNames.CacheControl] = "max-age=5184000"; } - else + else if (string.Equals(response.ContentType, "text/html", StringComparison.OrdinalIgnoreCase)) { - responseHeaders.CacheControl = new CacheControlHeaderValue - { - NoCache = true - }; + response.Headers[HeaderNames.CacheControl] = "no-cache"; } - } + }, + FileProvider = fileProvider }); - } - - public static void ConfigureDev(this IApplicationBuilder app) - { - var environment = app.ApplicationServices.GetRequiredService(); if (environment.IsDevelopment()) { - app.UseMiddleware(); + app.UseSpa(builder => + { + builder.UseProxyToSpaDevelopmentServer("https://localhost:3000"); + }); } } } diff --git a/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs b/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs index 9d09f4d04..08c677bae 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs @@ -155,8 +155,8 @@ namespace Squidex.Areas.IdentityServer.Config RedirectUris = { new Uri(urlGenerator.BuildUrl("login;")), - new Uri(urlGenerator.BuildUrl("client-callback-silent", false)), - new Uri(urlGenerator.BuildUrl("client-callback-popup", false)) + new Uri(urlGenerator.BuildUrl("client-callback-silent.html", false)), + new Uri(urlGenerator.BuildUrl("client-callback-popup.html", false)) }, PostLogoutRedirectUris = { diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs index 1c2a474ad..ae96f1d06 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Setup/SetupController.cs @@ -43,13 +43,6 @@ namespace Squidex.Areas.IdentityServer.Controllers.Setup this.userService = userService; } - [HttpGet] - [Route("webpack/")] - public IActionResult Webpack() - { - return View(); - } - [HttpGet] [Route("setup/")] public async Task Setup() diff --git a/backend/src/Squidex/Areas/IdentityServer/Views/Setup/Webpack.cshtml b/backend/src/Squidex/Areas/IdentityServer/Views/Setup/Webpack.cshtml deleted file mode 100644 index c303f026d..000000000 --- a/backend/src/Squidex/Areas/IdentityServer/Views/Setup/Webpack.cshtml +++ /dev/null @@ -1,75 +0,0 @@ -@{ - ViewBag.Title = T.Get("setup.webpack.title"); - - Layout = null; -} - - - - - - - - - - @ViewBag.Title - @T.Get("common.product") - - - - - -
- - -
-
- - -

@T.Get("setup.webpack.headline")

- -

@T.Get("setup.webpack.text")

- - @T.Get("common.documentation") -
-
- - -
- - \ No newline at end of file diff --git a/backend/src/Squidex/Areas/IdentityServer/Views/_Layout.cshtml b/backend/src/Squidex/Areas/IdentityServer/Views/_Layout.cshtml index 1a81215d9..f12e38a29 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Views/_Layout.cshtml +++ b/backend/src/Squidex/Areas/IdentityServer/Views/_Layout.cshtml @@ -8,9 +8,7 @@ @ViewBag.Title - @T.Get("common.product") - - - + @if (IsSectionDefined("header")) { @@ -19,7 +17,7 @@
- +
@@ -33,10 +31,5 @@
- - - - - \ No newline at end of file diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index 80fb73f37..c40bdb87b 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -48,6 +48,7 @@ + @@ -79,18 +80,23 @@ - + + true - + + + + + @@ -126,6 +132,7 @@ + @@ -156,6 +163,4 @@ $(NoWarn);CS1591;1591;1573;1572;NU1605;IDE0060 - - \ No newline at end of file diff --git a/backend/src/Squidex/Startup.cs b/backend/src/Squidex/Startup.cs index 224d63364..8f375b1b2 100644 --- a/backend/src/Squidex/Startup.cs +++ b/backend/src/Squidex/Startup.cs @@ -90,7 +90,6 @@ namespace Squidex app.UseSquidexLocalCache(); app.UseSquidexCors(); - app.ConfigureDev(); app.ConfigureApi(); app.ConfigurePortal(); app.ConfigureOrleansDashboard(); diff --git a/backend/src/Squidex/web.config b/backend/src/Squidex/web.config index 30a037d95..94b6c2890 100644 --- a/backend/src/Squidex/web.config +++ b/backend/src/Squidex/web.config @@ -1,11 +1,10 @@  - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/client-callback-popup.html b/backend/src/Squidex/wwwroot/client-callback-popup.html index 284daa7ad..b9facddf6 100644 --- a/backend/src/Squidex/wwwroot/client-callback-popup.html +++ b/backend/src/Squidex/wwwroot/client-callback-popup.html @@ -4,7 +4,7 @@ - + + + diff --git a/frontend/app/shared/services/auth.service.ts b/frontend/app/shared/services/auth.service.ts index afd8b7269..f5f3e71c4 100644 --- a/frontend/app/shared/services/auth.service.ts +++ b/frontend/app/shared/services/auth.service.ts @@ -102,8 +102,8 @@ export class AuthService { response_type: 'code', redirect_uri: apiUrl.buildUrl('login;'), post_logout_redirect_uri: apiUrl.buildUrl('logout'), - silent_redirect_uri: apiUrl.buildUrl('client-callback-silent'), - popup_redirect_uri: apiUrl.buildUrl('client-callback-popup'), + silent_redirect_uri: apiUrl.buildUrl('client-callback-silent.html'), + popup_redirect_uri: apiUrl.buildUrl('client-callback-popup.html'), authority: apiUrl.buildUrl('identity-server/'), userStore: new WebStorageStateStore({ store: window.localStorage || window.sessionStorage }), automaticSilentRenew: true, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7089f36d2..eb9998207 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -66,7 +66,7 @@ "@angular-devkit/build-optimizer": "0.1301.2", "@angular/cli": "^13.1.2", "@angular/compiler": "13.1.1", - "@angular/compiler-cli": "13.1.1", + "@angular/compiler-cli": "^13.1.1", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@ngtools/webpack": "13.1.2", "@types/codemirror": "0.0.108", @@ -84,6 +84,7 @@ "@types/ws": "8.2.2", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1", + "babel-loader": "^8.2.3", "browserslist": "4.19.1", "caniuse-lite": "1.0.30001294", "circular-dependency-plugin": "5.2.2", @@ -3079,6 +3080,69 @@ "ast-types-flow": "0.0.7" } }, + "node_modules/babel-loader": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", + "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", + "dev": true, + "dependencies": { + "find-cache-dir": "^3.3.1", + "loader-utils": "^1.4.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" + }, + "engines": { + "node": ">= 8.9" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "webpack": ">=2" + } + }, + "node_modules/babel-loader/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/babel-loader/node_modules/loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/babel-loader/node_modules/schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 8.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/babel-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", @@ -3851,6 +3915,12 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -6360,6 +6430,23 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, "node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -10409,6 +10496,18 @@ "pkcs7": "bin/cli.js" } }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/portfinder": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", @@ -14609,18 +14708,6 @@ "node": ">=8" } }, - "node_modules/webpack-cli/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/webpack-cli/node_modules/resolve-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", @@ -17412,6 +17499,51 @@ "ast-types-flow": "0.0.7" } }, + "babel-loader": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", + "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", + "dev": true, + "requires": { + "find-cache-dir": "^3.3.1", + "loader-utils": "^1.4.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + } + } + }, "babel-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", @@ -18030,6 +18162,12 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -19957,6 +20095,17 @@ } } }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -22970,6 +23119,15 @@ "@babel/runtime": "^7.5.5" } }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, "portfinder": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", @@ -26012,15 +26170,6 @@ "path-key": "^3.0.0" } }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, "resolve-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index fc923a8c0..6cd816c8b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "https://github.com/SebastianStehle/Squidex", "scripts": { - "start": "webpack serve --config app-config/webpack.config.js --port 3000 --hot --server-type https --https-pfx ../dev/squidex-dev.pfx --https-passphrase password --env WEBPACK_SERVE", + "start": "webpack serve --config app-config/webpack.config.js --port 3000 --hot --server-type https --server-options-pfx ../dev/squidex-dev.pfx --server-options-passphrase password --env WEBPACK_SERVE", "test": "karma start", "test:coverage": "karma start karma.coverage.conf.js", "test:clean": "rimraf _test-output", @@ -74,7 +74,7 @@ "@angular-devkit/build-optimizer": "0.1301.2", "@angular/cli": "^13.1.2", "@angular/compiler": "13.1.1", - "@angular/compiler-cli": "13.1.1", + "@angular/compiler-cli": "^13.1.1", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@ngtools/webpack": "13.1.2", "@types/codemirror": "0.0.108", @@ -92,6 +92,7 @@ "@types/ws": "8.2.2", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1", + "babel-loader": "^8.2.3", "browserslist": "4.19.1", "caniuse-lite": "1.0.30001294", "circular-dependency-plugin": "5.2.2",