From e57a2057844bd968d3ac2f6e6ca31bd7380b3977 Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Wed, 17 Apr 2024 18:25:49 +0400 Subject: [PATCH] Refactor imports to utilize absolute paths This commit changes all project imports to use absolute paths instead of relative ones. In addition, the 'tsconfig.json' has been updated to recognize new paths, aiding in easier project navigation and improved readability. The implemented changes result in cleaner imports and a more comprehensible project structure. --- src/components/Meta.astro | 6 ++-- src/components/sections/Authentication.astro | 8 ++--- src/components/sections/ContactSection.astro | 14 ++++---- src/components/sections/FAQ.astro | 2 +- src/components/sections/FooterSection.astro | 14 ++++---- src/components/sections/Navbar.astro | 12 +++---- .../sections/features/FeaturesGeneral.astro | 4 +-- .../sections/features/FeaturesNavs.astro | 6 ++-- .../sections/features/FeaturesStats.astro | 4 +-- .../sections/features/FeaturesStatsAlt.astro | 2 +- .../sections/fr/ContactSection_fr.astro | 14 ++++---- .../sections/landing/HeroSection.astro | 6 ++-- .../sections/landing/HeroSectionAlt.astro | 2 +- .../sections/pricing/PricingSection.astro | 4 +-- src/components/ui/LanguagePicker.astro | 2 +- src/components/ui/blocks/AccordionItem.astro | 2 +- src/components/ui/blocks/LeftSection.astro | 2 +- src/components/ui/blocks/MainSection.astro | 2 +- .../ui/blocks/ReviewComponent.astro | 6 ++-- src/components/ui/blocks/RightSection.astro | 2 +- src/components/ui/blocks/StatsGrid.astro | 2 +- src/components/ui/buttons/Bookmark.astro | 2 +- src/components/ui/buttons/Btn404.astro | 2 +- src/components/ui/buttons/GithubBtn.astro | 2 +- src/components/ui/buttons/PrimaryCTA.astro | 2 +- src/components/ui/buttons/SocialShare.astro | 2 +- src/components/ui/cards/CardBlog.astro | 4 +-- src/components/ui/cards/CardBlogRecent.astro | 4 +-- src/components/ui/cards/CardInsight.astro | 2 +- src/components/ui/cards/CardRelated.astro | 2 +- src/components/ui/cards/CardSmall.astro | 2 +- src/components/ui/cards/CardWide.astro | 2 +- src/components/ui/forms/LoginModal.astro | 4 +-- src/components/ui/forms/RecoverModal.astro | 2 +- src/components/ui/forms/RegisterModal.astro | 4 +-- src/components/ui/starlight/SiteTitle.astro | 4 +-- src/layouts/MainLayout.astro | 8 ++--- src/pages/404.astro | 4 +-- src/pages/blog/[...slug].astro | 14 ++++---- src/pages/blog/index.astro | 8 ++--- src/pages/contact.astro | 4 +-- src/pages/fr/404.astro | 2 +- src/pages/fr/blog/index.astro | 8 ++--- src/pages/fr/contact.astro | 2 +- src/pages/fr/index.astro | 34 +++++++++---------- src/pages/fr/products/index.astro | 10 +++--- src/pages/fr/services.astro | 24 ++++++------- src/pages/index.astro | 34 +++++++++---------- src/pages/insights/[...slug].astro | 2 +- src/pages/products/[...slug].astro | 6 ++-- src/pages/products/index.astro | 12 +++---- src/pages/services.astro | 26 +++++++------- tsconfig.json | 8 ++++- 53 files changed, 184 insertions(+), 178 deletions(-) diff --git a/src/components/Meta.astro b/src/components/Meta.astro index 208219a..7589e23 100644 --- a/src/components/Meta.astro +++ b/src/components/Meta.astro @@ -1,8 +1,8 @@ --- import { getImage } from "astro:assets"; -import { OG, SEO, SITE } from "@/data_files/constants"; -import faviconSvgSrc from "@/images/icon.svg"; -import faviconSrc from "@/images/icon.png"; +import { OG, SEO, SITE } from "@data/constants"; +import faviconSvgSrc from "@images/icon.svg"; +import faviconSrc from "@images/icon.png"; // Default properties for the Meta component. These values are used if props are not provided. // 'meta' sets a default description meta tag to describe the page content. diff --git a/src/components/sections/Authentication.astro b/src/components/sections/Authentication.astro index ab6f840..319c472 100644 --- a/src/components/sections/Authentication.astro +++ b/src/components/sections/Authentication.astro @@ -1,9 +1,9 @@ --- // Import the necessary components from their respective component files -import LoginModal from "../ui/forms/LoginModal.astro"; -import RegisterModal from "../ui/forms/RegisterModal.astro"; -import RecoverModal from "../ui/forms/RecoverModal.astro"; -import LoginBtn from "../ui/buttons/LoginBtn.astro"; +import LoginModal from "@components/ui/forms/LoginModal.astro"; +import RegisterModal from "@components/ui/forms/RegisterModal.astro"; +import RecoverModal from "@components/ui/forms/RecoverModal.astro"; +import LoginBtn from "@components/ui/buttons/LoginBtn.astro"; --- diff --git a/src/components/sections/ContactSection.astro b/src/components/sections/ContactSection.astro index 4555a16..80d42df 100644 --- a/src/components/sections/ContactSection.astro +++ b/src/components/sections/ContactSection.astro @@ -1,12 +1,12 @@ --- // Import the necessary dependencies. -import AuthBtn from "../ui/buttons/AuthBtn.astro"; -import ContactIconBlock from "../ui/blocks/ContactIconBlock.astro"; -import TextInput from "../ui/forms/input/TextInput.astro"; -import EmailContactInput from "../ui/forms/input/EmailContactInput.astro"; -import PhoneInput from "../ui/forms/input/PhoneInput.astro"; -import TextAreaInput from "../ui/forms/input/TextAreaInput.astro"; -import Icon from "../ui/icons/Icon.astro"; +import AuthBtn from "@components/ui/buttons/AuthBtn.astro"; +import ContactIconBlock from "@components/ui/blocks/ContactIconBlock.astro"; +import TextInput from "@components/ui/forms/input/TextInput.astro"; +import EmailContactInput from "@components/ui/forms/input/EmailContactInput.astro"; +import PhoneInput from "@components/ui/forms/input/PhoneInput.astro"; +import TextAreaInput from "@components/ui/forms/input/TextAreaInput.astro"; +import Icon from "@components/ui/icons/Icon.astro"; // Define the variables that will be used in this component const title: string = "Contact us"; diff --git a/src/components/sections/FAQ.astro b/src/components/sections/FAQ.astro index 90ee0f3..bddfa02 100644 --- a/src/components/sections/FAQ.astro +++ b/src/components/sections/FAQ.astro @@ -1,6 +1,6 @@ --- // Import the necessary AccordionItem component and JSON data -import AccordionItem from "../ui/blocks/AccordionItem.astro"; +import AccordionItem from "@components/ui/blocks/AccordionItem.astro"; // Define props from Astro const { title, faqs } = Astro.props; diff --git a/src/components/sections/FooterSection.astro b/src/components/sections/FooterSection.astro index 60ae4fa..9923e18 100644 --- a/src/components/sections/FooterSection.astro +++ b/src/components/sections/FooterSection.astro @@ -1,12 +1,12 @@ --- // Import the necessary dependencies -import FooterSocialLink from "../ui/links/FooterSocialLink.astro"; -import EmailFooterInput from "../ui/forms/input/EmailFooterInput.astro"; -import enStrings from "@/utils/navigation.ts"; -import frStrings from "@/utils/fr/navigation.ts"; -import Icon from "../ui/icons/Icon.astro"; -import BrandLogo from "@/components/BrandLogo.astro"; -import { SITE } from "@/data_files/constants"; +import FooterSocialLink from "@components/ui/links/FooterSocialLink.astro"; +import EmailFooterInput from "@components/ui/forms/input/EmailFooterInput.astro"; +import enStrings from "@utils/navigation.ts"; +import frStrings from "@utils/fr/navigation.ts"; +import Icon from "@components/ui/icons/Icon.astro"; +import BrandLogo from "@components/BrandLogo.astro"; +import { SITE } from "@data/constants"; // Select the correct translation based on the page's lang prop: const strings = Astro.currentLocale === "fr" ? frStrings : enStrings; diff --git a/src/components/sections/Navbar.astro b/src/components/sections/Navbar.astro index 1dd3323..9e0fced 100644 --- a/src/components/sections/Navbar.astro +++ b/src/components/sections/Navbar.astro @@ -1,12 +1,12 @@ --- //Import relevant dependencies -import ThemeIcon from "../ThemeIcon.astro"; -import NavLink from "../ui/links/NavLink.astro"; +import ThemeIcon from "@components/ThemeIcon.astro"; +import NavLink from "@components/ui/links/NavLink.astro"; import Authentication from "./Authentication.astro"; -import enStrings from "@/utils/navigation.ts"; -import frStrings from "@/utils/fr/navigation.ts"; -import BrandLogo from "../BrandLogo.astro"; -import LanguagePicker from "../ui/LanguagePicker.astro"; +import enStrings from "@utils/navigation.ts"; +import frStrings from "@utils/fr/navigation.ts"; +import BrandLogo from "@components/BrandLogo.astro"; +import LanguagePicker from "@components/ui/LanguagePicker.astro"; // Select the correct translation based on the page's lang prop: const strings = Astro.currentLocale === "fr" ? frStrings : enStrings; diff --git a/src/components/sections/features/FeaturesGeneral.astro b/src/components/sections/features/FeaturesGeneral.astro index be4c6d2..9bbe42a 100644 --- a/src/components/sections/features/FeaturesGeneral.astro +++ b/src/components/sections/features/FeaturesGeneral.astro @@ -1,8 +1,8 @@ --- // Import the necessary dependencies import { Image } from "astro:assets"; -import IconBlock from "../../ui/blocks/IconBlock.astro"; -import Icon from "../../ui/icons/Icon.astro"; +import IconBlock from "@components/ui/blocks/IconBlock.astro"; +import Icon from "@components/ui/icons/Icon.astro"; interface Feature { heading: string; diff --git a/src/components/sections/features/FeaturesNavs.astro b/src/components/sections/features/FeaturesNavs.astro index 96c215a..50de15c 100644 --- a/src/components/sections/features/FeaturesNavs.astro +++ b/src/components/sections/features/FeaturesNavs.astro @@ -1,8 +1,8 @@ --- // Import the necessary dependencies -import TabNav from "../../ui/blocks/TabNav.astro"; -import TabContent from "../../ui/blocks/TabContent.astro"; -import Icon from "../../ui/icons/Icon.astro"; +import TabNav from "@components/ui/blocks/TabNav.astro"; +import TabContent from "@components/ui/blocks/TabContent.astro"; +import Icon from "@components/ui/icons/Icon.astro"; // Define props from Astro const { title, tabs } = Astro.props; diff --git a/src/components/sections/features/FeaturesStats.astro b/src/components/sections/features/FeaturesStats.astro index 184b6e1..75e067c 100644 --- a/src/components/sections/features/FeaturesStats.astro +++ b/src/components/sections/features/FeaturesStats.astro @@ -1,7 +1,7 @@ --- // Import the necessary components -import StatsBig from "../../ui/blocks/StatsBig.astro"; -import StatsSmall from "../../ui/blocks/StatsSmall.astro"; +import StatsBig from "@components/ui/blocks/StatsBig.astro"; +import StatsSmall from "@components/ui/blocks/StatsSmall.astro"; const { title, subTitle, stats, mainStatTitle, mainStatSubTitle } = Astro.props; diff --git a/src/components/sections/features/FeaturesStatsAlt.astro b/src/components/sections/features/FeaturesStatsAlt.astro index e83d8f6..65a0f81 100644 --- a/src/components/sections/features/FeaturesStatsAlt.astro +++ b/src/components/sections/features/FeaturesStatsAlt.astro @@ -1,6 +1,6 @@ --- import { Image } from "astro:assets"; -import product5 from "@/images/features-image.avif"; +import product5 from "@images/features-image.avif"; // Define props from Astro const { title, subTitle, benefits } = Astro.props; diff --git a/src/components/sections/fr/ContactSection_fr.astro b/src/components/sections/fr/ContactSection_fr.astro index e0623b2..bf0e607 100644 --- a/src/components/sections/fr/ContactSection_fr.astro +++ b/src/components/sections/fr/ContactSection_fr.astro @@ -1,12 +1,12 @@ --- // Import the necessary dependencies. -import AuthBtn from "../../ui/buttons/AuthBtn.astro"; -import ContactIconBlock from "../../ui/blocks/ContactIconBlock.astro"; -import TextInput from "../../ui/forms/input/TextInput.astro"; -import EmailContactInput from "../../ui/forms/input/EmailContactInput.astro"; -import PhoneInput from "../../ui/forms/input/PhoneInput.astro"; -import TextAreaInput from "../../ui/forms/input/TextAreaInput.astro"; -import Icon from "../../ui/icons/Icon.astro"; +import AuthBtn from "@components/ui/buttons/AuthBtn.astro"; +import ContactIconBlock from "@components/ui/blocks/ContactIconBlock.astro"; +import TextInput from "@components/ui/forms/input/TextInput.astro"; +import EmailContactInput from "@components/ui/forms/input/EmailContactInput.astro"; +import PhoneInput from "@components/ui/forms/input/PhoneInput.astro"; +import TextAreaInput from "@components/ui/forms/input/TextAreaInput.astro"; +import Icon from "@components/ui/icons/Icon.astro"; // Define the variables that will be used in this component const title: string = "Contactez-nous"; diff --git a/src/components/sections/landing/HeroSection.astro b/src/components/sections/landing/HeroSection.astro index 5bb6c0b..d90980b 100644 --- a/src/components/sections/landing/HeroSection.astro +++ b/src/components/sections/landing/HeroSection.astro @@ -1,9 +1,9 @@ --- // Import the necessary dependencies import { Image } from "astro:assets"; -import PrimaryCTA from "../../ui/buttons/PrimaryCTA.astro"; -import SecondaryCTA from "../../ui/buttons/SecondaryCTA.astro"; -import ReviewComponent from "../../ui/blocks/ReviewComponent.astro"; +import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; +import SecondaryCTA from "@components/ui/buttons/SecondaryCTA.astro"; +import ReviewComponent from "@components/ui/blocks/ReviewComponent.astro"; // Define props from Astro const { diff --git a/src/components/sections/landing/HeroSectionAlt.astro b/src/components/sections/landing/HeroSectionAlt.astro index ff0079a..c98679d 100644 --- a/src/components/sections/landing/HeroSectionAlt.astro +++ b/src/components/sections/landing/HeroSectionAlt.astro @@ -1,6 +1,6 @@ --- // Import the necessary dependencies -import GithubBtn from "../../ui/buttons/GithubBtn.astro"; +import GithubBtn from "@components/ui/buttons/GithubBtn.astro"; // Define props from Astro const { title, subTitle, url } = Astro.props; diff --git a/src/components/sections/pricing/PricingSection.astro b/src/components/sections/pricing/PricingSection.astro index 2d882f1..c07b873 100644 --- a/src/components/sections/pricing/PricingSection.astro +++ b/src/components/sections/pricing/PricingSection.astro @@ -1,7 +1,7 @@ --- // Import SecondaryCTA component for use in this module -import SecondaryCTA from "../../ui/buttons/SecondaryCTA.astro"; -import Icon from "../../ui/icons/Icon.astro"; +import SecondaryCTA from "@components/ui/buttons/SecondaryCTA.astro"; +import Icon from "@components/ui/icons/Icon.astro"; // Define props from Astro const { pricing } = Astro.props; diff --git a/src/components/ui/LanguagePicker.astro b/src/components/ui/LanguagePicker.astro index 1989778..5325c8f 100644 --- a/src/components/ui/LanguagePicker.astro +++ b/src/components/ui/LanguagePicker.astro @@ -1,5 +1,5 @@ --- -import { languages } from "@/utils//ui"; +import { languages } from "@utils//ui"; import Icon from "./icons/Icon.astro"; --- diff --git a/src/components/ui/blocks/AccordionItem.astro b/src/components/ui/blocks/AccordionItem.astro index 04d04ec..1ddc49f 100644 --- a/src/components/ui/blocks/AccordionItem.astro +++ b/src/components/ui/blocks/AccordionItem.astro @@ -1,5 +1,5 @@ --- -import Icon from "../icons/Icon.astro"; +import Icon from "@components/ui/icons/Icon.astro"; // Define props from Astro const { id, collapseId, question, answer, first } = Astro.props; // Define TypeScript interface for props diff --git a/src/components/ui/blocks/LeftSection.astro b/src/components/ui/blocks/LeftSection.astro index 5277505..05c3443 100644 --- a/src/components/ui/blocks/LeftSection.astro +++ b/src/components/ui/blocks/LeftSection.astro @@ -1,7 +1,7 @@ --- // Import the necessary modules import { Image } from "astro:assets"; -import PrimaryCTA from "../buttons/PrimaryCTA.astro"; +import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; // Destructure the props passed to the Astro component const { title, subTitle, btnExists, btnTitle, btnURL, img, imgAlt } = Astro.props; diff --git a/src/components/ui/blocks/MainSection.astro b/src/components/ui/blocks/MainSection.astro index e3f649d..15c873a 100644 --- a/src/components/ui/blocks/MainSection.astro +++ b/src/components/ui/blocks/MainSection.astro @@ -1,6 +1,6 @@ --- // Import PrimaryCTA component -import PrimaryCTA from "../buttons/PrimaryCTA.astro"; +import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; // Destructure the props passed to the Astro component const { title, subTitle, btnExists, btnTitle, btnURL } = Astro.props; diff --git a/src/components/ui/blocks/ReviewComponent.astro b/src/components/ui/blocks/ReviewComponent.astro index 0791cf8..a892d15 100644 --- a/src/components/ui/blocks/ReviewComponent.astro +++ b/src/components/ui/blocks/ReviewComponent.astro @@ -1,7 +1,7 @@ --- -import Avatar from "../../ui/avatars/Avatar.astro"; -import FullStar from "../../ui/stars/FullStar.astro"; -import HalfStar from "../../ui/stars/HalfStar.astro"; +import Avatar from "@components/ui/avatars/Avatar.astro"; +import FullStar from "@components/ui/stars/FullStar.astro"; +import HalfStar from "@components/ui/stars/HalfStar.astro"; const { avatars, starCount = 0, rating, reviews } = Astro.props; diff --git a/src/components/ui/blocks/RightSection.astro b/src/components/ui/blocks/RightSection.astro index d9bab0f..5480ac7 100644 --- a/src/components/ui/blocks/RightSection.astro +++ b/src/components/ui/blocks/RightSection.astro @@ -1,7 +1,7 @@ --- // Import the required modules import { Image } from "astro:assets"; -import PrimaryCTA from "../buttons/PrimaryCTA.astro"; +import PrimaryCTA from "@components/ui/buttons/PrimaryCTA.astro"; // Extract properties from Astro.props const { title, diff --git a/src/components/ui/blocks/StatsGrid.astro b/src/components/ui/blocks/StatsGrid.astro index c8446ff..b49536c 100644 --- a/src/components/ui/blocks/StatsGrid.astro +++ b/src/components/ui/blocks/StatsGrid.astro @@ -1,5 +1,5 @@ --- -import Icon from "../icons/Icon.astro"; +import Icon from "@components/ui/icons/Icon.astro"; const { count, description, index } = Astro.props; diff --git a/src/components/ui/buttons/Bookmark.astro b/src/components/ui/buttons/Bookmark.astro index 5265406..c517aa8 100644 --- a/src/components/ui/buttons/Bookmark.astro +++ b/src/components/ui/buttons/Bookmark.astro @@ -1,5 +1,5 @@ --- -import Icon from "../icons/Icon.astro"; +import Icon from "@components/ui/icons/Icon.astro"; ---