Merged in feat/sw-2863-move-contentstack-router-to-trpc-package (pull request #2389)

feat(SW-2863): Move contentstack router to trpc package

* Add exports to packages and lint rule to prevent relative imports

* Add env to trpc package

* Add eslint to trpc package

* Apply lint rules

* Use direct imports from trpc package

* Add lint-staged config to trpc

* Move lang enum to common

* Restructure trpc package folder structure

* WIP first step

* update internal imports in trpc

* Fix most errors in scandic-web

Just 100 left...

* Move Props type out of trpc

* Fix CategorizedFilters types

* Move more schemas in hotel router

* Fix deps

* fix getNonContentstackUrls

* Fix import error

* Fix entry error handling

* Fix generateMetadata metrics

* Fix alertType enum

* Fix duplicated types

* lint:fix

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package

* Fix broken imports

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-06-26 07:53:01 +00:00
parent 0263ab8c87
commit 002d093af4
921 changed files with 3112 additions and 3008 deletions

View File

@@ -0,0 +1,128 @@
#import "../SysAsset.graphql"
#import "../ImageContainer.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/CampaignPageLink.graphql"
#import "../PageLink/CollectionPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/DestinationCityPageLink.graphql"
#import "../PageLink/DestinationCountryPageLink.graphql"
#import "../PageLink/DestinationOverviewPageLink.graphql"
#import "../PageLink/HotelPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../PageLink/StartPageLink.graphql"
#import "../AccountPage/Ref.graphql"
#import "../CampaignPage/Ref.graphql"
#import "../CollectionPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../DestinationCityPage/Ref.graphql"
#import "../DestinationCountryPage/Ref.graphql"
#import "../DestinationOverviewPage/Ref.graphql"
#import "../HotelPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../StartPage/Ref.graphql"
fragment ContentSidebar_ContentPage on ContentPageSidebarContent {
content {
content {
json
embedded_itemsConnection {
edges {
node {
__typename
...SysAsset
...ImageContainer
...AccountPageLink
...CampaignPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
}
}
fragment ContentSidebar_ContentPageRefs on ContentPageSidebarContent {
content {
content {
embedded_itemsConnection {
edges {
node {
__typename
...ImageContainerRef
...AccountPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
}
}
fragment ContentSidebar_LoyaltyPage on LoyaltyPageSidebarContent {
content {
content {
json
embedded_itemsConnection {
edges {
node {
__typename
...SysAsset
...ImageContainer
...AccountPageLink
...CampaignPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
}
}
fragment ContentSidebar_LoyaltyPageRefs on LoyaltyPageSidebarContent {
content {
content {
embedded_itemsConnection {
edges {
node {
__typename
...ImageContainerRef
...AccountPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fragment DynamicContentSidebar_ContentPage on ContentPageSidebarDynamicContent {
dynamic_content {
component
}
}
fragment DynamicContentSidebar_LoyaltyPage on LoyaltyPageSidebarDynamicContent {
dynamic_content {
component
}
}

View File

@@ -0,0 +1,155 @@
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/CampaignPageLink.graphql"
#import "../PageLink/CollectionPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/DestinationCityPageLink.graphql"
#import "../PageLink/DestinationCountryPageLink.graphql"
#import "../PageLink/DestinationOverviewPageLink.graphql"
#import "../PageLink/HotelPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../PageLink/StartPageLink.graphql"
#import "../AccountPage/Ref.graphql"
#import "../CampaignPage/Ref.graphql"
#import "../CollectionPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../DestinationCityPage/Ref.graphql"
#import "../DestinationCountryPage/Ref.graphql"
#import "../DestinationOverviewPage/Ref.graphql"
#import "../HotelPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../StartPage/Ref.graphql"
fragment ContactFields on ContactFields {
display_text
contact_field
contact_footnote
}
fragment JoinLoyaltyContactSidebar_ContentPage on ContentPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
preamble
title
button {
cta_text
open_in_new_tab
external_link {
href
title
}
linkConnection {
edges {
node {
__typename
...AccountPageLink
...CampaignPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
contact {
__typename
... on ContentPageSidebarJoinLoyaltyContactBlockContactContact {
contact {
...ContactFields
}
}
}
}
}
fragment JoinLoyaltyContactSidebar_ContentPageRefs on ContentPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
}
}
fragment JoinLoyaltyContactSidebar_LoyaltyPage on LoyaltyPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
preamble
title
button {
cta_text
open_in_new_tab
external_link {
href
title
}
linkConnection {
edges {
node {
__typename
...AccountPageLink
...CampaignPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
contact {
__typename
... on LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact {
contact {
...ContactFields
}
}
}
}
}
fragment JoinLoyaltyContactSidebar_LoyaltyPageRefs on LoyaltyPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
}
}

View File

@@ -0,0 +1,23 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/Shortcuts.graphql"
fragment QuickLinksSidebar_ContentPage on ContentPageSidebarShortcuts {
__typename
shortcuts {
...Shortcuts
}
}
fragment QuickLinksSidebar_ContentPageRefs on ContentPageSidebarShortcuts {
shortcuts {
__typename
...ShortcutsRefs
}
}

View File

@@ -0,0 +1,38 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/Card.graphql"
#import "../Blocks/Refs/Card.graphql"
fragment ScriptedCardSidebar_ContentPage on ContentPageSidebarScriptedCard {
__typename
scripted_card {
theme
scripted_cardConnection {
edges {
node {
__typename
...CardBlock
}
}
}
}
}
fragment ScriptedCardSidebar_ContentPageRefs on ContentPageSidebarScriptedCard {
scripted_card {
scripted_cardConnection {
edges {
node {
__typename
...CardBlockRef
}
}
}
}
}

View File

@@ -0,0 +1,38 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/TeaserCard.graphql"
#import "../Blocks/Refs/TeaserCard.graphql"
fragment TeaserCardSidebar_ContentPage on ContentPageSidebarTeaserCard {
__typename
teaser_card {
theme
teaser_cardConnection {
edges {
node {
__typename
...TeaserCardBlock
}
}
}
}
}
fragment TeaserCardSidebar_ContentPageRefs on ContentPageSidebarTeaserCard {
teaser_card {
teaser_cardConnection {
edges {
node {
__typename
...TeaserCardBlockRef
}
}
}
}
}