From f78fca594a2c595bbf850215eb097fe51df41d94 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Wed, 18 Dec 2024 08:41:03 -0500 Subject: [PATCH] chore: app router - /getting-started page (#18185) * remove env vars * move pages to /app * remove Head component * remove pages router * add to config matcher * fix --- .env.example | 1 - apps/web/abTest/middlewareFactory.ts | 1 - .../{future => }/getting-started/[[...step]]/page.tsx | 0 apps/web/middleware.ts | 3 +-- .../getting-started/[[...step]]/onboarding-view.tsx | 6 ------ apps/web/pages/getting-started/[[...step]].tsx | 10 ---------- apps/web/scripts/vercel-app-router-deploy.sh | 1 - turbo.json | 1 - 8 files changed, 1 insertion(+), 22 deletions(-) rename apps/web/app/{future => }/getting-started/[[...step]]/page.tsx (100%) delete mode 100644 apps/web/pages/getting-started/[[...step]].tsx diff --git a/.env.example b/.env.example index 9c0724dd08..931ed06679 100644 --- a/.env.example +++ b/.env.example @@ -363,7 +363,6 @@ APP_ROUTER_APPS_CATEGORIES_ENABLED=0 APP_ROUTER_APPS_CATEGORIES_CATEGORY_ENABLED=0 APP_ROUTER_BOOKING_ENABLED=0 APP_ROUTER_BOOKINGS_STATUS_ENABLED=0 -APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0 APP_ROUTER_APPS_ENABLED=0 APP_ROUTER_TEAM_ENABLED=0 APP_ROUTER_TEAMS_ENABLED=0 diff --git a/apps/web/abTest/middlewareFactory.ts b/apps/web/abTest/middlewareFactory.ts index e3555464be..4428b29d5b 100644 --- a/apps/web/abTest/middlewareFactory.ts +++ b/apps/web/abTest/middlewareFactory.ts @@ -20,7 +20,6 @@ const ROUTES: [URLPattern, boolean][] = [ ["/auth/error", process.env.APP_ROUTER_AUTH_ERROR_ENABLED === "1"] as const, ["/auth/platform/:path*", process.env.APP_ROUTER_AUTH_PLATFORM_ENABLED === "1"] as const, ["/auth/oauth2/:path*", process.env.APP_ROUTER_AUTH_OAUTH2_ENABLED === "1"] as const, - ["/getting-started/:step", process.env.APP_ROUTER_GETTING_STARTED_STEP_ENABLED === "1"] as const, ["/bookings/:status", process.env.APP_ROUTER_BOOKINGS_STATUS_ENABLED === "1"] as const, ["/booking/:path*", process.env.APP_ROUTER_BOOKING_ENABLED === "1"] as const, ["/team", process.env.APP_ROUTER_TEAM_ENABLED === "1"] as const, diff --git a/apps/web/app/future/getting-started/[[...step]]/page.tsx b/apps/web/app/getting-started/[[...step]]/page.tsx similarity index 100% rename from apps/web/app/future/getting-started/[[...step]]/page.tsx rename to apps/web/app/getting-started/[[...step]]/page.tsx diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index 1290b8bd17..5833afdbe7 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -184,8 +184,7 @@ export const config = { "/apps/categories/:category/", "/future/apps/categories/:category/", "/workflows/:path*", - "/getting-started/:step/", - "/future/getting-started/:step/", + "/getting-started/:path*", "/apps", "/bookings/:status/", "/future/bookings/:status/", diff --git a/apps/web/modules/getting-started/[[...step]]/onboarding-view.tsx b/apps/web/modules/getting-started/[[...step]]/onboarding-view.tsx index 6bf55279c1..17fd6d9a8b 100644 --- a/apps/web/modules/getting-started/[[...step]]/onboarding-view.tsx +++ b/apps/web/modules/getting-started/[[...step]]/onboarding-view.tsx @@ -2,7 +2,6 @@ import { signOut } from "next-auth/react"; import type { TFunction } from "next-i18next"; -import Head from "next/head"; import { usePathname, useRouter } from "next/navigation"; import { Suspense } from "react"; import { Toaster } from "react-hot-toast"; @@ -147,11 +146,6 @@ const OnboardingPage = (props: PageProps) => { )} data-testid="onboarding" key={pathname}> - - {`${APP_NAME} - ${t("getting_started")}`} - - -
diff --git a/apps/web/pages/getting-started/[[...step]].tsx b/apps/web/pages/getting-started/[[...step]].tsx deleted file mode 100644 index 37a605a374..0000000000 --- a/apps/web/pages/getting-started/[[...step]].tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import type { PageProps } from "~/getting-started/[[...step]]/onboarding-view"; -import OnboardingPage from "~/getting-started/[[...step]]/onboarding-view"; - -const Page = (props: PageProps) => ; - -export { getServerSideProps } from "@lib/getting-started/[[...step]]/getServerSideProps"; -Page.PageWrapper = PageWrapper; -export default Page; diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.sh index 591c0b3c3c..1e4fcb745b 100755 --- a/apps/web/scripts/vercel-app-router-deploy.sh +++ b/apps/web/scripts/vercel-app-router-deploy.sh @@ -20,7 +20,6 @@ checkRoute "$APP_ROUTER_AUTH_SAML_ENABLED" app/future/auth/saml-idp checkRoute "$APP_ROUTER_AUTH_ERROR_ENABLED" app/future/auth/error checkRoute "$APP_ROUTER_AUTH_PLATFORM_ENABLED" app/future/auth/platform checkRoute "$APP_ROUTER_AUTH_OAUTH2_ENABLED" app/future/auth/oauth2 -checkRoute "$APP_ROUTER_GETTING_STARTED_STEP_ENABLED" app/future/getting-started checkRoute "$APP_ROUTER_BOOKINGS_STATUS_ENABLED" app/future/bookings checkRoute "$APP_ROUTER_BOOKING_ENABLED" app/future/booking checkRoute "$APP_ROUTER_TEAM_ENABLED" app/future/team diff --git a/turbo.json b/turbo.json index 8a61f7725d..f288885af3 100644 --- a/turbo.json +++ b/turbo.json @@ -243,7 +243,6 @@ "APP_ROUTER_BOOKING_ENABLED", "APP_ROUTER_BOOKINGS_STATUS_ENABLED", "APP_ROUTER_EVENT_TYPES_ENABLED", - "APP_ROUTER_GETTING_STARTED_STEP_ENABLED", "APP_ROUTER_AUTH_FORGOT_PASSWORD_ENABLED", "APP_ROUTER_AUTH_LOGIN_ENABLED", "APP_ROUTER_AUTH_LOGOUT_ENABLED",