From 2b19e3440d39f02dc458fb03b0e0b2171ca5055e Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Tue, 19 Mar 2024 22:37:26 -0400 Subject: [PATCH] Add namespace paths. --- app/src/frontend/components/form/login-form.tsx | 2 +- app/src/frontend/components/form/register-form.tsx | 2 +- app/src/frontend/layout/footer.tsx | 2 +- app/src/frontend/pages/home.tsx | 4 ++-- app/src/frontend/pages/login.tsx | 4 ++-- app/src/frontend/pages/register.tsx | 4 ++-- app/src/handlers/user.tsx | 4 ++-- app/src/middleware/siteData.ts | 2 +- app/src/model/Channel.ts | 6 +++--- app/src/model/Episode.ts | 2 +- app/tsconfig.json | 7 +++++-- 11 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/src/frontend/components/form/login-form.tsx b/app/src/frontend/components/form/login-form.tsx index 6776b8c..2f29126 100644 --- a/app/src/frontend/components/form/login-form.tsx +++ b/app/src/frontend/components/form/login-form.tsx @@ -1,5 +1,5 @@ import { FC } from "hono/jsx" -import ErrorMessage from "./error-message"; +import ErrorMessage from "@slovo/frontend/components/form/error-message"; export const LoginForm: FC = (props) => { return ( diff --git a/app/src/frontend/components/form/register-form.tsx b/app/src/frontend/components/form/register-form.tsx index ca84d25..356f321 100644 --- a/app/src/frontend/components/form/register-form.tsx +++ b/app/src/frontend/components/form/register-form.tsx @@ -1,5 +1,5 @@ import { FC } from 'hono/jsx'; -import ErrorMessage from './error-message'; +import ErrorMessage from '@slovo/frontend/components/form/error-message'; export const RegisterForm: FC = (props) => { diff --git a/app/src/frontend/layout/footer.tsx b/app/src/frontend/layout/footer.tsx index 3817951..9c37f4e 100644 --- a/app/src/frontend/layout/footer.tsx +++ b/app/src/frontend/layout/footer.tsx @@ -1,6 +1,6 @@ import { FC } from 'hono/jsx'; -const currentYear = new Date().getFullYear(); +// const currentYear = new Date().getFullYear(); const Footer: FC = (props) => { return ( diff --git a/app/src/frontend/pages/home.tsx b/app/src/frontend/pages/home.tsx index 4b07f04..5be23a4 100644 --- a/app/src/frontend/pages/home.tsx +++ b/app/src/frontend/pages/home.tsx @@ -1,6 +1,6 @@ -import { Layout } from "../layout"; +import { Layout } from "@slovo/frontend/layout"; -export const HomePage = (props) => { +export const HomePage = () => { return (
Welcome to Slovocast
diff --git a/app/src/frontend/pages/login.tsx b/app/src/frontend/pages/login.tsx index fe8c34f..ea40f39 100644 --- a/app/src/frontend/pages/login.tsx +++ b/app/src/frontend/pages/login.tsx @@ -1,5 +1,5 @@ -import { Layout } from '../layout'; -import { LoginForm } from '../components/login-form'; +import { Layout } from '@slovo/frontend/layout'; +import { LoginForm } from '@slovo/frontend/components/form/login-form'; export const LoginPage = (props: { error?: any }) => { return ( diff --git a/app/src/frontend/pages/register.tsx b/app/src/frontend/pages/register.tsx index 36022fb..6fbed4c 100644 --- a/app/src/frontend/pages/register.tsx +++ b/app/src/frontend/pages/register.tsx @@ -1,5 +1,5 @@ -import { RegisterForm } from '../components/register-form'; -import { Layout } from '../layout'; +import { RegisterForm } from '@slovo/frontend/components/form/register-form'; +import { Layout } from '@slovo/frontend/layout'; export const RegisterPage = (props: { error?: any }) => { return ( diff --git a/app/src/handlers/user.tsx b/app/src/handlers/user.tsx index 1dfaea5..353a435 100644 --- a/app/src/handlers/user.tsx +++ b/app/src/handlers/user.tsx @@ -1,7 +1,7 @@ import { Hono } from 'hono'; import { Context } from 'hono'; -import { LoginPage } from '../frontend/pages/login'; -import { RegisterPage } from '../frontend/pages/register'; +import { LoginPage } from '@slovo/frontend/pages/login'; +import { RegisterPage } from '@slovo/frontend/pages/register'; const UserHandler = new Hono(); diff --git a/app/src/middleware/siteData.ts b/app/src/middleware/siteData.ts index b7a4ec5..ea5d944 100644 --- a/app/src/middleware/siteData.ts +++ b/app/src/middleware/siteData.ts @@ -1,5 +1,5 @@ import { Context } from 'hono'; -import SiteData from '../model/SiteData'; +import SiteData from '@slovo/model/SiteData'; const currentYear = new Date().getFullYear(); diff --git a/app/src/model/Channel.ts b/app/src/model/Channel.ts index 9610bd9..1bb4f56 100644 --- a/app/src/model/Channel.ts +++ b/app/src/model/Channel.ts @@ -1,6 +1,6 @@ -import Category from './Category'; -import Image from './Image'; -import Episode from './Episode'; +import Category from '@slovo/model/Category'; +import Image from '@slovo/model/Image'; +import Episode from '@slovo/model/Episode'; type Channel = { name: string, diff --git a/app/src/model/Episode.ts b/app/src/model/Episode.ts index 3d30efa..9a6f59a 100644 --- a/app/src/model/Episode.ts +++ b/app/src/model/Episode.ts @@ -1,4 +1,4 @@ -import Image from './Image'; +import Image from '@slovo/model/Image'; type Episode = { title: string, diff --git a/app/tsconfig.json b/app/tsconfig.json index c442b33..eb6af7d 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -2,6 +2,9 @@ "compilerOptions": { "strict": true, "jsx": "react-jsx", - "jsxImportSource": "hono/jsx" + "jsxImportSource": "hono/jsx", + "paths": { + "@slovo/*": [ "src/*" ] + } } -} \ No newline at end of file +}