From 506b3bb07d5853185beef1dbe699ff80479eb57b Mon Sep 17 00:00:00 2001 From: Daniel B Date: Sat, 9 Dec 2023 18:11:12 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20Correct=20file=20structur?= =?UTF-8?q?e=20=E2=80=A2=20Index=20src=20as=20main=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsconfig.json | 7 +++++++ src/app/layout.jsx | 4 ++-- src/app/layout.test.jsx | 2 +- src/app/page.jsx | 4 ++-- src/components/atoms/loginButton.jsx | 2 +- src/components/molecules/footer/component.jsx | 2 +- src/logic/auth/service.js | 2 +- src/logic/data/service.js | 6 +++--- vitest.config.js | 5 +++++ 9 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..862a989 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + } +} \ No newline at end of file diff --git a/src/app/layout.jsx b/src/app/layout.jsx index d47408b..6b36562 100644 --- a/src/app/layout.jsx +++ b/src/app/layout.jsx @@ -17,8 +17,8 @@ import "bootstrap/dist/css/bootstrap.min.css"; import React from "react"; //* Local Imports -import { getMetadata } from "../logic/metadata/service"; -import StateManager from "../logic/state/manager"; +import { getMetadata } from "@/logic/metadata/service"; +import StateManager from "@/logic/state/manager"; //* Main diff --git a/src/app/layout.test.jsx b/src/app/layout.test.jsx index 5714bf5..bf27c8f 100644 --- a/src/app/layout.test.jsx +++ b/src/app/layout.test.jsx @@ -29,7 +29,7 @@ vi.mock("@inrupt/solid-ui-react", () => ({ })); // Mocking the getMetadata function -vi.mock("./logic/metadata/service", () => ({ +vi.mock("../logic/metadata/service", () => ({ getMetadata: vi.fn().mockResolvedValue({ /* mock metadata object */ }) })); diff --git a/src/app/page.jsx b/src/app/page.jsx index 5a9022c..1bcfd93 100644 --- a/src/app/page.jsx +++ b/src/app/page.jsx @@ -17,8 +17,8 @@ import React from "react"; //* Local Imports import "./page.css"; -import Footer from "../components/molecules/footer/component"; -import AuthButton from "../components/atoms/authButton"; +import Footer from "@/components/molecules/footer/component"; +import AuthButton from "@/components/atoms/authButton"; //* Main diff --git a/src/components/atoms/loginButton.jsx b/src/components/atoms/loginButton.jsx index ababb29..9ff42da 100644 --- a/src/components/atoms/loginButton.jsx +++ b/src/components/atoms/loginButton.jsx @@ -20,7 +20,7 @@ import React, { useEffect, useState } from "react"; import { LoginButton as SolidLoginButton } from "@inrupt/solid-ui-react"; import { Button } from "react-bootstrap"; //* Local imports -import { getOptions } from "../../logic/auth/service"; +import { getOptions } from "@/logic/auth/service"; //* Main diff --git a/src/components/molecules/footer/component.jsx b/src/components/molecules/footer/component.jsx index ccbd434..d8a119e 100644 --- a/src/components/molecules/footer/component.jsx +++ b/src/components/molecules/footer/component.jsx @@ -18,7 +18,7 @@ //* Imports import Link from "next/link"; //* Local Imports -import useData from "../../../logic/data/hook"; +import useData from "@/logic/data/hook"; import FooterLayout from "./layout"; diff --git a/src/logic/auth/service.js b/src/logic/auth/service.js index 74b0f75..c944bfc 100644 --- a/src/logic/auth/service.js +++ b/src/logic/auth/service.js @@ -14,7 +14,7 @@ */ //* Imports -import { CLIENT_ID, POD_PROVIDER_URI } from "../../services/app/nodes"; +import { CLIENT_ID, POD_PROVIDER_URI } from "@/services/app/nodes"; export async function getOptions() { // Logic diff --git a/src/logic/data/service.js b/src/logic/data/service.js index 273b74a..7c9729b 100644 --- a/src/logic/data/service.js +++ b/src/logic/data/service.js @@ -16,9 +16,9 @@ //* Imports //* Local Imports -import { APP_WEBID, APP_WEBID_DOC } from "../../services/app/nodes"; -import { getProperties, getThing } from "../../services/solid/service"; -import { appShape } from "../../services/app/shape"; +import { APP_WEBID, APP_WEBID_DOC } from "@/services/app/nodes"; +import { getProperties, getThing } from "@/services/solid/service"; +import { appShape } from "@/services/app/shape"; //* Main diff --git a/vitest.config.js b/vitest.config.js index e8bddaa..80e5aa4 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -18,6 +18,11 @@ import { defineConfig } from "vitest/config"; //* Main export default defineConfig({ + resolve: { + alias: { + "@": "/src", + }, + }, test: { globals: true, environment: "jsdom",