From 028c77c923f14ac5729c205c5b6956b6272aede3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Wed, 7 Jan 2026 07:06:36 +0000 Subject: [PATCH] Merged in chore/check-types-before-build (pull request #3326) chore: check types before build * chore: check types before build * remove unused package.json scripts * merge Approved-by: Linus Flood --- apps/partner-sas/constants/bookingFlowConfig.ts | 2 +- apps/partner-sas/netlify.toml | 6 +++--- apps/partner-sas/turbo.json | 2 +- .../DynamicContent/Rewards/Redeem/index.tsx | 2 +- .../ContentType/CampaignPage/Hero/index.tsx | 3 ++- .../scandic-web/components/Forms/Signup/index.tsx | 8 ++++---- .../MyStay/Rooms/SingleRoom/index.tsx | 3 ++- .../MyStay/TermsAndConditions/index.tsx | 8 ++++---- .../LevelProgressModal/index.tsx | 2 +- .../Sidebar/JoinLoyalty/ReadMore/index.tsx | 2 +- apps/scandic-web/netlify.toml | 6 +++--- apps/scandic-web/turbo.json | 2 +- package.json | 2 -- .../lib/components/Button/variants.ts | 1 - packages/design-system/package.json | 2 -- packages/design-system/turbo.json | 2 +- packages/trpc/lib/types/blocks.ts | 5 +++-- packages/trpc/lib/types/collectionPage.ts | 15 +++++++++------ 18 files changed, 37 insertions(+), 36 deletions(-) diff --git a/apps/partner-sas/constants/bookingFlowConfig.ts b/apps/partner-sas/constants/bookingFlowConfig.ts index 57c67a39a..50da754e0 100644 --- a/apps/partner-sas/constants/bookingFlowConfig.ts +++ b/apps/partner-sas/constants/bookingFlowConfig.ts @@ -1,8 +1,8 @@ import { bookingTerms, customerService, - scandicFriends, privacy, + scandicFriends, } from "@scandic-hotels/common/constants/routes/customerService" import { myStay } from "@scandic-hotels/common/constants/routes/myStay" diff --git a/apps/partner-sas/netlify.toml b/apps/partner-sas/netlify.toml index dbf98833e..c57b7b6be 100644 --- a/apps/partner-sas/netlify.toml +++ b/apps/partner-sas/netlify.toml @@ -1,14 +1,14 @@ [build] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build --filter=@scandic-hotels/partner-sas" publish = "apps/partner-sas/.next" ignore = "if [ -z ${CACHED_COMMIT_REF+x} ] ; then echo 'no CACHED_COMMIT_REF found' && false ; else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF apps/partner-sas packages/booking-flow packages/common packages/trpc packages/design-system packages/typescript-config ; fi" [context.branch-deploy] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build --filter=@scandic-hotels/partner-sas" [context.deploy-preview] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build:sas" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/partner-sas && yarn build --filter=@scandic-hotels/partner-sas" [build.environment] # set TERM variable for terminal output diff --git a/apps/partner-sas/turbo.json b/apps/partner-sas/turbo.json index 9e9d23c4a..368a83378 100644 --- a/apps/partner-sas/turbo.json +++ b/apps/partner-sas/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "tasks": { "lint": { "dependsOn": [] }, - "build": { "dependsOn": ["clean", "include:shared"] }, + "build": { "dependsOn": ["clean", "include:shared", "check-types"] }, "dev": { "dependsOn": ["clean", "include:shared"] }, "test": { "dependsOn": [ diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/index.tsx index ae98b1001..cd9208399 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/index.tsx @@ -18,9 +18,9 @@ import { trpc } from "@scandic-hotels/trpc/client" import useLang from "@/hooks/useLang" import { isRestaurantOnSiteTierReward } from "@/utils/rewards" -import { ConfirmClose } from "./ConfirmClose" import RedeemCampaign from "./Flows/Campaign" import RedeemTier from "./Flows/Tier" +import { ConfirmClose } from "./ConfirmClose" import { RedeemContext } from "./useRedeemFlow" import styles from "./redeem.module.css" diff --git a/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx b/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx index 0fe18b8f6..409a95c91 100644 --- a/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx +++ b/apps/scandic-web/components/ContentType/CampaignPage/Hero/index.tsx @@ -16,7 +16,8 @@ import styles from "./hero.module.css" import type { Hero } from "@scandic-hotels/trpc/types/campaignPage" interface HeroProps - extends React.HTMLAttributes, + extends + React.HTMLAttributes, VariantProps, Omit { pageType?: "campaign" | "overview" | "hotelPage" diff --git a/apps/scandic-web/components/Forms/Signup/index.tsx b/apps/scandic-web/components/Forms/Signup/index.tsx index eb726c885..8f7194271 100644 --- a/apps/scandic-web/components/Forms/Signup/index.tsx +++ b/apps/scandic-web/components/Forms/Signup/index.tsx @@ -6,6 +6,10 @@ import { useRouter } from "next/navigation" import { FormProvider, useForm } from "react-hook-form" import { useIntl } from "react-intl" +import { + privacy, + scandicFriends, +} from "@scandic-hotels/common/constants/routes/customerService" import { logger } from "@scandic-hotels/common/logger" import { formatPhoneNumber, @@ -41,10 +45,6 @@ import { requestOpen } from "@/utils/profilingConsent" import { trackLinkClick } from "@/utils/tracking/profilingConsent" import styles from "./form.module.css" -import { - privacy, - scandicFriends, -} from "@scandic-hotels/common/constants/routes/customerService" interface SignUpFormProps { title: string diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/index.tsx index 336797344..d5fdfdfc6 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/index.tsx @@ -1,5 +1,7 @@ "use client" +import { cx } from "class-variance-authority" + import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" import { Typography } from "@scandic-hotels/design-system/Typography" @@ -17,7 +19,6 @@ import Packages from "./Packages" import styles from "./room.module.css" import type { SafeUser } from "@/types/user" -import { cx } from "class-variance-authority" interface RoomProps { user: SafeUser diff --git a/apps/scandic-web/components/HotelReservation/MyStay/TermsAndConditions/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/TermsAndConditions/index.tsx index ef7f74333..75b84ae0e 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/TermsAndConditions/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/TermsAndConditions/index.tsx @@ -1,6 +1,10 @@ import { useFormContext } from "react-hook-form" import { useIntl } from "react-intl" +import { + bookingTerms, + privacy, +} from "@scandic-hotels/common/constants/routes/customerService" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" import { ErrorMessage } from "@scandic-hotels/design-system/Form/ErrorMessage" import { TextLink } from "@scandic-hotels/design-system/TextLink" @@ -10,10 +14,6 @@ import useLang from "@/hooks/useLang" import { getErrorMessage } from "@/utils/getErrorMessage" import styles from "./termsAndConditions.module.css" -import { - bookingTerms, - privacy, -} from "@scandic-hotels/common/constants/routes/customerService" export default function TermsAndConditions() { const intl = useIntl() diff --git a/apps/scandic-web/components/MyPages/LevelProgressCard/LevelProgressModal/index.tsx b/apps/scandic-web/components/MyPages/LevelProgressCard/LevelProgressModal/index.tsx index 7f44adac2..f5626cf4d 100644 --- a/apps/scandic-web/components/MyPages/LevelProgressCard/LevelProgressModal/index.tsx +++ b/apps/scandic-web/components/MyPages/LevelProgressCard/LevelProgressModal/index.tsx @@ -4,7 +4,7 @@ import { useIntl } from "react-intl" import { dt } from "@scandic-hotels/common/dt" -import { IconButton } from "@scandic-hotels/design-system/IconButton"; // client only +import { IconButton } from "@scandic-hotels/design-system/IconButton" // client only import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import Modal from "@scandic-hotels/design-system/Modal" import Link from "@scandic-hotels/design-system/OldDSLink" diff --git a/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx b/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx index 7e291ed3c..6b3dc13e8 100644 --- a/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx +++ b/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx @@ -1,3 +1,4 @@ +import { scandicFriends } from "@scandic-hotels/common/constants/routes/myPages" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import Link from "@scandic-hotels/design-system/OldDSLink" import Subtitle from "@scandic-hotels/design-system/Subtitle" @@ -8,7 +9,6 @@ import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" import styles from "./readMore.module.css" -import { scandicFriends } from "@scandic-hotels/common/constants/routes/myPages" export default async function ReadMore() { const [intl, lang] = await Promise.all([getIntl(), getLang()]) diff --git a/apps/scandic-web/netlify.toml b/apps/scandic-web/netlify.toml index 70d95f978..5b3e32241 100644 --- a/apps/scandic-web/netlify.toml +++ b/apps/scandic-web/netlify.toml @@ -1,14 +1,14 @@ [build] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build --filter=@scandic-hotels/scandic-web" publish = "apps/scandic-web/.next" ignore = "if [ -z ${CACHED_COMMIT_REF+x} ] ; then echo 'no CACHED_COMMIT_REF found' && false ; else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF apps/scandic-web packages/booking-flow packages/common packages/trpc packages/design-system packages/typescript-config ; fi" [context.branch-deploy] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build --filter=@scandic-hotels/scandic-web" [context.deploy-preview] -command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'release-v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build:web" +command = "export NEXT_PUBLIC_RELEASE_TAG=$(git tag -l 'v*' | sort -V | tail -n 1) && yarn test --filter=@scandic-hotels/scandic-web && yarn build --filter=@scandic-hotels/scandic-web" [[plugins]] package = "@netlify/plugin-nextjs" diff --git a/apps/scandic-web/turbo.json b/apps/scandic-web/turbo.json index 3cf51e872..d44830b27 100644 --- a/apps/scandic-web/turbo.json +++ b/apps/scandic-web/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "tasks": { "lint": { "dependsOn": [] }, - "build": { "dependsOn": ["clean", "include:shared"] }, + "build": { "dependsOn": ["clean", "include:shared", "check-types"] }, "dev": { "dependsOn": ["clean", "include:shared"] }, "test": { "dependsOn": [ diff --git a/package.json b/package.json index b6ee0ee34..4aad0cb25 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,6 @@ "packageManager": "yarn@4.6.0", "scripts": { "build": "turbo run build --env-mode=loose", - "build:web": "turbo run build --filter=@scandic-hotels/scandic-web --env-mode=loose", - "build:sas": "turbo run build --filter=@scandic-hotels/partner-sas --env-mode=loose", "lint": "turbo run lint", "dev": "turbo run dev --output-logs new-only", "dev:web": "turbo run dev --filter=@scandic-hotels/scandic-web --output-logs new-only", diff --git a/packages/design-system/lib/components/Button/variants.ts b/packages/design-system/lib/components/Button/variants.ts index fae893d05..fa3814ddd 100644 --- a/packages/design-system/lib/components/Button/variants.ts +++ b/packages/design-system/lib/components/Button/variants.ts @@ -1,6 +1,5 @@ import { cva } from 'class-variance-authority' - import { deepmerge } from 'deepmerge-ts' import styles from './button.module.css' diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 7c1afc4f5..f05181a3c 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -217,8 +217,6 @@ "test": "vitest run --passWithNoTests", "test:s": "vitest --project=storybook", "test:watch": "vitest", - "prepack": "yarn run build", - "prepare": "husky && yarn run build", "check-types": "tsgo --noEmit", "test:browser": "vitest --config=vitest.browser.config.ts", "include:shared": "jiti ../../scripts/copyFiles.ts ../../shared public/_static/shared" diff --git a/packages/design-system/turbo.json b/packages/design-system/turbo.json index c062fd6af..7c6cd4ff5 100644 --- a/packages/design-system/turbo.json +++ b/packages/design-system/turbo.json @@ -2,7 +2,7 @@ "extends": ["//"], "tasks": { "build": { - "dependsOn": ["include:shared"], + "dependsOn": ["include:shared", "check-types"], "outputs": ["dist/**"] }, "dev": { diff --git a/packages/trpc/lib/types/blocks.ts b/packages/trpc/lib/types/blocks.ts index e987f8c51..3a3089e8d 100644 --- a/packages/trpc/lib/types/blocks.ts +++ b/packages/trpc/lib/types/blocks.ts @@ -24,8 +24,9 @@ export interface TableBlock extends z.output {} export type TableData = TableBlock["table"] export interface TextCols extends z.output {} export interface UspGrid extends z.output {} -interface GetHotelListing - extends z.output {} +interface GetHotelListing extends z.output< + typeof contentPageHotelListingSchema +> {} export type HotelListing = GetHotelListing["hotel_listing"] export interface CarouselCards extends z.output {} export interface CardGallery extends z.output {} diff --git a/packages/trpc/lib/types/collectionPage.ts b/packages/trpc/lib/types/collectionPage.ts index b50aa5bf3..23f765f88 100644 --- a/packages/trpc/lib/types/collectionPage.ts +++ b/packages/trpc/lib/types/collectionPage.ts @@ -6,14 +6,17 @@ import type { collectionPageSchema, } from "../routers/contentstack/collectionPage/output" -export interface GetCollectionPageRefsSchema - extends z.input {} +export interface GetCollectionPageRefsSchema extends z.input< + typeof collectionPageRefsSchema +> {} -export interface CollectionPageRefs - extends z.output {} +export interface CollectionPageRefs extends z.output< + typeof collectionPageRefsSchema +> {} -export interface GetCollectionPageSchema - extends z.input {} +export interface GetCollectionPageSchema extends z.input< + typeof collectionPageSchema +> {} export interface CollectionPage extends z.output {}