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