这是indexloc提供的服务,不要输入任何密码
Skip to content

hotfix: broken blank layout and fix shared models implementation #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions functions/src/models/shared.ts
Original file line number Diff line number Diff line change
@@ -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";
15 changes: 15 additions & 0 deletions hosting/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import {fileURLToPath} from "url";
import path from "path";

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
Expand All @@ -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;
2 changes: 2 additions & 0 deletions hosting/src/app/(public)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import "@/assets/css/satoshi.css";
import "@/assets/css/style.css";
import React from "react";

interface PublicLayoutProps {
Expand Down
6 changes: 4 additions & 2 deletions hosting/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"plugins": [
{
"name": "next"
}
],
"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"]
}