diff --git a/functions/src/models/shared.ts b/functions/src/models/shared.ts new file mode 100644 index 00000000..dcb307d7 --- /dev/null +++ b/functions/src/models/shared.ts @@ -0,0 +1,8 @@ +// A place to register models that will be shared with the frontend. +// Models that can be shared with the frontend are only models that contain DTO (Data Transfer Object), without any dependency packages in them. +// Because it's a bit tricky to handle share model files +// if there are load dependency packages in them and some packages sometimes only support server side. +export * from "./LocalizedString"; +export * from "./TanamDocument"; +export * from "./TanamDocumentField"; +export * from "./TanamDocumentType"; diff --git a/hosting/next.config.mjs b/hosting/next.config.mjs index 0b94176c..6fc665b0 100644 --- a/hosting/next.config.mjs +++ b/hosting/next.config.mjs @@ -1,3 +1,6 @@ +import {fileURLToPath} from "url"; +import path from "path"; + /** @type {import('next').NextConfig} */ const nextConfig = { images: { @@ -12,6 +15,18 @@ const nextConfig = { }, ]; }, + webpack: (config) => { + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + + config.resolve.alias = { + ...config.resolve.alias, + "@shared/models": path.resolve(__dirname, "./../functions-ts/src/models/shared"), + "@shared/definitions": path.resolve(__dirname, "./../functions-ts/src/definitions"), + }; + + return config; + }, }; export default nextConfig; diff --git a/hosting/src/app/(public)/layout.tsx b/hosting/src/app/(public)/layout.tsx index 12fca35e..7a69c065 100644 --- a/hosting/src/app/(public)/layout.tsx +++ b/hosting/src/app/(public)/layout.tsx @@ -1,5 +1,7 @@ "use client"; +import "@/assets/css/satoshi.css"; +import "@/assets/css/style.css"; import React from "react"; interface PublicLayoutProps { diff --git a/hosting/tsconfig.json b/hosting/tsconfig.json index 13bfbaeb..e21faa3c 100644 --- a/hosting/tsconfig.json +++ b/hosting/tsconfig.json @@ -12,6 +12,7 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "baseUrl": ".", "plugins": [ { "name": "next" @@ -19,9 +20,10 @@ ], "paths": { "@/*": ["./src/*"], - "@functions/*": ["../functions/src/*"] + "@functions/models/*": ["./../functions/src/models/shared"], + "@functions/definitions/*": ["./../functions/src/definitions/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "../functions/src/**/*.ts"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] }