mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-31 11:13:02 +08:00
chore: add import alias
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { Menu, Popover } from "@headlessui/react";
|
||||
import Link from "next/link";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { getAssistantById, useChatStore, useMessageStore } from "../../store";
|
||||
import { getAssistantById, useChatStore, useMessageStore } from "@/store";
|
||||
import Icon from "../Icon";
|
||||
|
||||
const Header = () => {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import TextareaAutosize from "react-textarea-autosize";
|
||||
import { localUser, useChatStore, useMessageStore } from "../../store";
|
||||
import { CreatorRole } from "../../types";
|
||||
import { generateUUID } from "../../utils";
|
||||
import { localUser, useChatStore, useMessageStore } from "@/store";
|
||||
import { CreatorRole } from "@/types";
|
||||
import { generateUUID } from "@/utils";
|
||||
import Icon from "../Icon";
|
||||
|
||||
interface Props {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { marked } from "marked";
|
||||
import { localUser } from "../../store";
|
||||
import { Message } from "../../types";
|
||||
import { localUser } from "@/store";
|
||||
import { Message } from "@/types";
|
||||
|
||||
interface Props {
|
||||
message: Message;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import axios from "axios";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { defaultChat, getAssistantById, getPromptOfAssistant, localUser, useChatStore, useMessageStore } from "../../store";
|
||||
import { Chat, CreatorRole, Message } from "../../types";
|
||||
import { generateUUID } from "../../utils";
|
||||
import { defaultChat, getAssistantById, getPromptOfAssistant, localUser, useChatStore, useMessageStore } from "@/store";
|
||||
import { Chat, CreatorRole, Message } from "@/types";
|
||||
import { generateUUID } from "@/utils";
|
||||
import Icon from "../Icon";
|
||||
import Header from "./Header";
|
||||
import MessageView from "./MessageView";
|
||||
|
@ -2,8 +2,8 @@ import { AppProps } from "next/app";
|
||||
import React from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import "../styles/tailwind.css";
|
||||
import "../styles/global.css";
|
||||
import "@/styles/tailwind.css";
|
||||
import "@/styles/global.css";
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
|
@ -2,7 +2,7 @@ import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
import Icon from "../components/Icon";
|
||||
import Icon from "@/components/Icon";
|
||||
|
||||
const HomePage: NextPage = () => {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import openai from "../../utils/openai-api";
|
||||
import openai from "@/utils/openai-api";
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const completionResponse = await openai.createChatCompletion({
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import React from "react";
|
||||
import ChatView from "../components/ChatView";
|
||||
import ChatView from "@/components/ChatView";
|
||||
|
||||
const ChatPage: NextPage = () => {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { first } from "lodash-es";
|
||||
import { Id, User } from "../types";
|
||||
import { Id, User } from "@/types";
|
||||
|
||||
// Assistant is a special user.
|
||||
export const assistantList: User[] = [
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
import { Chat, UNKNOWN_ID, User } from "../types";
|
||||
import { generateUUID } from "../utils";
|
||||
import { Chat, UNKNOWN_ID, User } from "@/types";
|
||||
import { generateUUID } from "@/utils";
|
||||
|
||||
export const defaultChat: Chat = {
|
||||
id: generateUUID(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
import { Message } from "../types";
|
||||
import { Message } from "@/types";
|
||||
|
||||
interface MessageState {
|
||||
messageList: Message[];
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { User } from "../types";
|
||||
import { User } from "@/types";
|
||||
|
||||
export const localUser: User = {
|
||||
id: "local-user",
|
||||
|
@ -13,7 +13,10 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Id } from "./common";
|
||||
import { Id } from "./";
|
||||
|
||||
export interface Chat {
|
||||
id: string;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Id } from "./common";
|
||||
import { Id } from "./";
|
||||
|
||||
enum Engine {
|
||||
MySQL = "MYSQL",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Id } from "./common";
|
||||
import { Id } from "./";
|
||||
|
||||
export interface Database {
|
||||
connectionId: Id;
|
||||
|
@ -1,4 +1,6 @@
|
||||
export * from "./common";
|
||||
export * from "./user";
|
||||
export * from "./connection";
|
||||
export * from "./database";
|
||||
export * from "./chat";
|
||||
export * from "./message";
|
||||
|
Reference in New Issue
Block a user