feat: Support running webapp and embed-core playground on HTTPS. It allows to test SameSite cookie attribute easily in embed (#15272)
* feat: Support running webapp and embed-core playground on HTTPS. It allows to test SameSite attribute easily in embed * Update yarn.lock * feat: Support running webapp and embed-core playground on HTTPS. It allows to test SameSite attribute easily in embed * Update yarn.lock * Fix git-setup.sh * Fix yarn.lock
This commit is contained in:
1 parent
50338dcd61
commit
ececef96e5
8 files changed
+254
-51
No files matched your search
@@ -389,6 +389,6 @@
|
||||
<h3><a href="?only=ns:columnView">Test Column View</a></h3>
|
||||
<div class="place" style="width: 100%"></div>
|
||||
</div>
|
||||
<script src="./playground.ts"></script>
|
||||
<script type="module" src="./playground.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,8 +19,10 @@
|
||||
"build-preview": "PREVIEW_BUILD=1 yarn __build ",
|
||||
"vite": "vite",
|
||||
"tailwind": "yarn tailwindcss -i ./src/styles.css -o ./src/tailwind.generated.css",
|
||||
"buildWatchAndServer": "run-p '__dev' 'vite --port 3100 --strict-port --open'",
|
||||
"buildWatchAndServer": "run-p '__dev' 'vite --port 3100 --strict-port --host --open'",
|
||||
"buildWatchAndServer-https": "run-p '__dev' 'vite --port 3100 --strict-port --host --open --https'",
|
||||
"dev": "yarn tailwind && run-p 'tailwind --watch' 'buildWatchAndServer'",
|
||||
"dev-https": "yarn tailwind && run-p 'tailwind --watch' 'buildWatchAndServer-https'",
|
||||
"dev-real": "vite dev --port 3100",
|
||||
"type-check": "tsc --pretty --noEmit",
|
||||
"type-check:ci": "tsc-absolute --pretty --noEmit",
|
||||
@@ -45,6 +47,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.31.2",
|
||||
"@vitejs/plugin-basic-ssl": "^1.1.0",
|
||||
"autoprefixer": "^10.4.12",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.4.18",
|
||||
|
||||
@@ -6,6 +6,7 @@ const callback = function (e) {
|
||||
console.log("Event: ", e.type, detail);
|
||||
};
|
||||
|
||||
const origin = `${new URL(document.URL).protocol}localhost:3000`;
|
||||
document.addEventListener("click", (e) => {
|
||||
const target = e.target as HTMLElement;
|
||||
if ("href" in target && typeof target.href === "string") {
|
||||
@@ -42,7 +43,7 @@ const calLink = searchParams.get("cal-link");
|
||||
if (only === "all" || only === "ns:default") {
|
||||
Cal("init", {
|
||||
debug: true,
|
||||
calOrigin: "http://localhost:3000",
|
||||
calOrigin: origin,
|
||||
});
|
||||
|
||||
Cal("inline", {
|
||||
@@ -68,7 +69,7 @@ if (only === "all" || only === "ns:second") {
|
||||
// Create a namespace "second". It can be accessed as Cal.ns.second with the exact same API as Cal
|
||||
Cal("init", "second", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.second(
|
||||
@@ -95,7 +96,7 @@ if (only === "all" || only === "ns:third") {
|
||||
// Create a namespace "third". It can be accessed as Cal.ns.second with the exact same API as Cal
|
||||
Cal("init", "third", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.third(
|
||||
@@ -146,7 +147,7 @@ if (only === "all" || only === "ns:third") {
|
||||
if (only === "all" || only === "ns:fourth") {
|
||||
Cal("init", "fourth", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
Cal.ns.fourth(
|
||||
[
|
||||
@@ -190,7 +191,7 @@ if (only === "all" || only === "ns:fourth") {
|
||||
if (only === "all" || only === "ns:fifth") {
|
||||
Cal("init", "fifth", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
Cal.ns.fifth([
|
||||
"inline",
|
||||
@@ -215,7 +216,7 @@ if (only === "all" || only === "ns:fifth") {
|
||||
if (only === "all" || only === "prerender-test") {
|
||||
Cal("init", "e2ePrerenderLightTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
Cal.ns.e2ePrerenderLightTheme("prerender", {
|
||||
calLink: "free/30min",
|
||||
@@ -226,7 +227,7 @@ if (only === "all" || only === "prerender-test") {
|
||||
if (only === "all" || only === "preload-test") {
|
||||
Cal("init", "preloadTest", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
Cal.ns.preloadTest("preload", {
|
||||
calLink: "free/30min",
|
||||
@@ -236,7 +237,7 @@ if (only === "all" || only === "preload-test") {
|
||||
if (only === "all" || only === "inline-routing-form") {
|
||||
Cal("init", "inline-routing-form", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
Cal.ns["inline-routing-form"]([
|
||||
"inline",
|
||||
@@ -258,7 +259,7 @@ if (only === "all" || only === "hideEventTypeDetails") {
|
||||
const identifier = "hideEventTypeDetails";
|
||||
Cal("init", identifier, {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.hideEventTypeDetails(
|
||||
@@ -288,7 +289,7 @@ if (only === "all" || only === "hideEventTypeDetails") {
|
||||
if (only === "conflicting-theme") {
|
||||
Cal("init", "conflictingTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.conflictingTheme("inline", {
|
||||
@@ -309,17 +310,17 @@ if (only === "conflicting-theme") {
|
||||
|
||||
Cal("init", "popupDarkTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "e2ePopupLightTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupHideEventTypeDetails", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.popupHideEventTypeDetails("ui", {
|
||||
@@ -328,52 +329,52 @@ Cal.ns.popupHideEventTypeDetails("ui", {
|
||||
|
||||
Cal("init", "popupReschedule", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupAutoTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupTeamLinkLightTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupTeamLinkDarkTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupTeamLinkDarkTheme", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupTeamLinksList", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "popupPaidEvent", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "childElementTarget", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "floatingButton", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal("init", "routingFormAuto", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.routingFormAuto("on", {
|
||||
@@ -387,7 +388,7 @@ Cal.ns.routingFormAuto("on", {
|
||||
|
||||
Cal("init", "routingFormDark", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
if (only === "all" || only == "ns:floatingButton") {
|
||||
@@ -416,7 +417,7 @@ if (only === "all" || only == "ns:monthView") {
|
||||
// Create a namespace "second". It can be accessed as Cal.ns.second with the exact same API as Cal
|
||||
Cal("init", "monthView", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.monthView(
|
||||
@@ -444,7 +445,7 @@ if (only === "all" || only == "ns:weekView") {
|
||||
// Create a namespace "second". It can be accessed as Cal.ns.second with the exact same API as Cal
|
||||
Cal("init", "weekView", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.weekView(
|
||||
@@ -472,7 +473,7 @@ if (only === "all" || only == "ns:columnView") {
|
||||
// Create a namespace "second". It can be accessed as Cal.ns.second with the exact same API as Cal
|
||||
Cal("init", "columnView", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
origin: origin,
|
||||
});
|
||||
|
||||
Cal.ns.columnView(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import basicSsl from "@vitejs/plugin-basic-ssl";
|
||||
import EnvironmentPlugin from "vite-plugin-environment";
|
||||
|
||||
import viteBaseConfig, { embedCoreEnvVars } from "../vite.config";
|
||||
@@ -15,6 +16,7 @@ module.exports = defineConfig((configEnv) => {
|
||||
EMBED_PUBLIC_VERCEL_URL: embedCoreEnvVars.EMBED_PUBLIC_VERCEL_URL,
|
||||
EMBED_PUBLIC_WEBAPP_URL: embedCoreEnvVars.EMBED_PUBLIC_WEBAPP_URL,
|
||||
}),
|
||||
...(process.argv.includes("--https") ? [basicSsl()] : []),
|
||||
],
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
|
||||
Reference in new issue
Block a user