From df6a4b8b61181bae40298a7031bb66af6373ebb7 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Mon, 14 Oct 2024 11:01:10 +0200 Subject: [PATCH] SONAR-23205 Migrate build system to vite --- .../saml/SamlAuthStatusPageGenerator.java | 2 +- .../src/main/resources/samlAuthResult.html | 24 +- server/sonar-web/babel.config.js | 23 + server/sonar-web/config/esbuild-config.js | 77 - .../sonar-web/config/esbuild-html-plugin.js | 60 - server/sonar-web/config/indexHtmlTemplate.js | 58 - server/sonar-web/config/process-shim.js | 22 - server/sonar-web/config/utils.js | 8 +- ...ths.js => vite-dev-server-html-plugin.mjs} | 17 +- server/sonar-web/index.html | 43 + server/sonar-web/package.json | 26 +- server/sonar-web/scripts/build.js | 57 - server/sonar-web/scripts/start.js | 135 -- server/sonar-web/src/main/js/app/index.ts | 8 +- .../main/js/app/{theme.js => theme-old.js} | 0 server/sonar-web/src/main/js/app/theme.ts | 277 +++ .../create/project/__tests__/Manual-it.tsx | 2 +- .../js/apps/issues/__tests__/IssuesApp-it.tsx | 2 +- .../__tests__/IssuesSourceViewer-it.tsx | 2 +- .../__tests__/ProjectQualityGateApp-it.tsx | 7 +- .../projectQualityProfilesApp-it.tsx | 2 +- .../__tests__/TutorialsApp-test.tsx | 2 +- server/sonar-web/vite.config.mjs | 168 ++ server/sonar-web/yarn.lock | 1628 ++++++++++++++--- .../SamlValidationRedirectionFilter.java | 2 +- .../sonar/server/platform/web/CspFilter.java | 3 +- .../server/platform/web/WebPagesCache.java | 2 +- .../server/platform/web/CspFilterTest.java | 2 +- .../platform/web/WebPagesCacheTest.java | 2 +- 29 files changed, 1954 insertions(+), 707 deletions(-) create mode 100644 server/sonar-web/babel.config.js delete mode 100644 server/sonar-web/config/esbuild-config.js delete mode 100644 server/sonar-web/config/esbuild-html-plugin.js delete mode 100644 server/sonar-web/config/indexHtmlTemplate.js delete mode 100644 server/sonar-web/config/process-shim.js rename server/sonar-web/config/{paths.js => vite-dev-server-html-plugin.mjs} (71%) create mode 100644 server/sonar-web/index.html delete mode 100644 server/sonar-web/scripts/build.js delete mode 100644 server/sonar-web/scripts/start.js rename server/sonar-web/src/main/js/app/{theme.js => theme-old.js} (100%) create mode 100644 server/sonar-web/src/main/js/app/theme.ts create mode 100644 server/sonar-web/vite.config.mjs diff --git a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlAuthStatusPageGenerator.java b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlAuthStatusPageGenerator.java index 672f384f746..62f9071a84f 100644 --- a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlAuthStatusPageGenerator.java +++ b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlAuthStatusPageGenerator.java @@ -30,7 +30,7 @@ import org.sonar.api.server.http.HttpRequest; public final class SamlAuthStatusPageGenerator { - private static final String WEB_CONTEXT = "%WEB_CONTEXT%"; + private static final String WEB_CONTEXT = "WEB_CONTEXT"; private static final String SAML_AUTHENTICATION_STATUS = "%SAML_AUTHENTICATION_STATUS%"; private static final String HTML_TEMPLATE_NAME = "samlAuthResult.html"; diff --git a/server/sonar-auth-saml/src/main/resources/samlAuthResult.html b/server/sonar-auth-saml/src/main/resources/samlAuthResult.html index bff1c9ef20d..945a8a68c83 100644 --- a/server/sonar-auth-saml/src/main/resources/samlAuthResult.html +++ b/server/sonar-auth-saml/src/main/resources/samlAuthResult.html @@ -3,40 +3,40 @@ - - - - - + + + + + - + - + SAML Authentication Test