Skip to content

Commit e44e9e0

Browse files
committedApr 16, 2024·
Remove unused files and update styles
1 parent 55ecfa7 commit e44e9e0

18 files changed

+655
-540
lines changed
 

‎app/components/Common/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Link } from "@remix-run/react";
22

33
export const Header = () => {
44
return (
5-
<header className="flex border-b w-full bg-white dark:bg-[#262626] p-3 justify-between dark:text-white text-slate-900 dark:border-gray-600">
5+
<header className="flex border-b w-full bg-[#0C0C0C] p-3 justify-between text-white border-gray-600">
66
<Link
77
to="/"
88
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-700 flex items-center dark:text-white"

‎app/components/Home/ExampleSearch.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const HomeExampleSearchCard = ({
1212
<button
1313
type="submit"
1414
onClick={onClick}
15-
className="border truncate dark:border-gray-700 text-slate-900 dark:text-slate-50 md:hover:text-slate-700 md:dark:hover:text-slate-200 text-center items-center rounded-full cursor-point active:scale-95 origin-center whitespace-nowrap inline-flex text-xs px-3 font-medium h-6"
15+
className=" truncate bg-[#222831] text-slate-50 md:hover:text-slate-700 md:dark:hover:text-slate-200 text-center items-center rounded-md cursor-point active:scale-95 origin-center whitespace-nowrap inline-flex text-xs px-3 font-medium h-6"
1616
>
1717
{name}
1818
</button>
@@ -21,8 +21,8 @@ export const HomeExampleSearchCard = ({
2121

2222
export const HomeExampleSearch = () => {
2323
const query = [
24-
"Generate Image of Astronaut Riding a Horse",
2524
"What available models are mentioned on this site: https://readme.fireworks.ai/docs/querying-embeddings-models?",
25+
"Generate Image of Astronaut Riding a Horse",
2626
"When is Juventus' next game?",
2727
"How many kilometers from Washingto D.C. to Miami Beach?",
2828
];

‎app/components/Home/Form.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ export const HomeForm = () => {
55
const [query, setQuery] = React.useState("");
66

77
return (
8-
<Form method="post" className="w-full max-w-2xl">
9-
<div className="w-full border flex flex-col dark:border-gray-600 rounded-xl p-2 dark:bg-[#242424]">
8+
<Form method="post" className="w-full max-w-3xl">
9+
<div className="bg-gradient-to-r from-pink-500 to-yellow-500 rounded-xl p-[3px]">
10+
11+
<div className="w-full flex flex-col rounded-xl p-2 bg-[#242424]">
1012
<input
1113
className="px-2 py-2 w-full resize-none bg-transparent focus-within:outline-none focus:ring-0 focus-visible:ring-0 ring-0 dark:ring-0 border-0 dark:text-gray-100"
1214
required
1315
name="query"
14-
style={{ minHeight: "60px" }}
16+
style={{ minHeight: "40px" }}
1517
tabIndex={0}
1618
placeholder="Type your query here..."
1719
value={query}
@@ -37,6 +39,7 @@ export const HomeForm = () => {
3739
</svg>
3840
</button>
3941
</div>
42+
</div>
4043
</div>
4144
</Form>
4245
);

‎app/components/Search/Markdown.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import remarkGfm from "remark-gfm";
2-
import rehypeMathjax from "rehype-mathjax";
32
import remarkMath from "remark-math";
43
import ReactMarkdown from "react-markdown";
54
import "property-information";
@@ -12,7 +11,6 @@ export default function Markdown({ message }: { message: string }) {
1211
<ReactMarkdown
1312
className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 dark:prose-dark"
1413
remarkPlugins={[remarkGfm, remarkMath]}
15-
rehypePlugins={[rehypeMathjax]}
1614
components={{
1715

1816
a({ node, ...props }) {

‎app/components/Search/Source.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const SearchSourceCard = ({ url }: { url: string }) => {
66
<a
77
href={url}
88
target="_blank"
9-
className="border dark:border-gray-700 text-slate-900 dark:text-slate-50 md:hover:text-slate-700 md:dark:hover:text-slate-200 justify-center text-center items-center rounded-full cursor-point active:scale-95 origin-center whitespace-nowrap inline-flex text-xs px-3 font-medium h-6"
9+
className=" truncate bg-[#222831] text-slate-50 md:hover:text-slate-700 md:dark:hover:text-slate-200 text-center items-center rounded-md cursor-point active:scale-95 origin-center whitespace-nowrap inline-flex text-xs px-3 font-medium h-6"
1010
>
1111
{hostname}
1212
<ArrowUpRightIcon className="h-3 w-3 ml-1" />
@@ -24,7 +24,7 @@ export const SearchSources = ({ links }: { links: string[] }) => {
2424
<span className="text-lg font-bold dark:text-white text-slate-900">
2525
Sources
2626
</span>
27-
<div className="flex mt-4 flex-wrap gap-4 md:items-center md:justify-center md:gap-4">
27+
<div className="flex mt-4 flex-wrap gap-4 items-start md:items-center md:gap-4">
2828
{links.map((url, i) => (
2929
<SearchSourceCard key={i} url={url} />
3030
))}

‎app/root.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import type { LinksFunction } from "@remix-run/node";
33
import {
44
Link,
55
Links,
6-
LiveReload,
76
Meta,
87
Outlet,
98
Scripts,
109
ScrollRestoration,
1110
} from "@remix-run/react";
12-
import stylesheet from "~/css/tailwind.css";
11+
import stylesheet from "~/css/tailwind.css?url";
1312
import { Header } from "./components/Common/Header";
1413
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
1514
import React from "react";
@@ -41,11 +40,10 @@ export default function App() {
4140
</head>
4241
<QueryClientProvider client={queryClient}>
4342
<Header />
44-
<body className="bg-white dark:bg-[#262626]">
43+
<body className="bg-[#0C0C0C]">
4544
<Outlet />
4645
<ScrollRestoration />
4746
<Scripts />
48-
<LiveReload />
4947
</body>
5048
</QueryClientProvider>
5149
</html>

‎app/routes/_index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export async function action({ request }: ActionFunctionArgs) {
3434

3535
export default function Index() {
3636
return (
37-
<div className="flex p-6 flex-col items-center justify-center h-screen bg-white dark:bg-[#262626] dark:text-white w-full">
37+
<div className="flex p-6 flex-col items-center justify-center h-screen bg-[#0C0C0C] text-white w-full">
3838
<div className="mb-6">
39-
<h1 className="text-2xl text-center dark:text-white text-slate-900">
39+
<h1 className="text-2xl text-center text-white">
4040
What you want to do today?
4141
</h1>
4242
</div>

‎app/routes/search.$slug.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default function Index() {
9191
});
9292

9393
return (
94-
<div className="flex p-6 flex-col items-center justify-center bg-white dark:bg-[#262626] dark:text-white w-full">
94+
<div className="flex p-6 flex-col items-center justify-center h-screen bg-[#0C0C0C] text-white w-full">
9595
<div className="max-w-2xl w-full mb-4 h-screen max-h-screen">
9696
<SearchForm q={query} />
9797
{status === "pending" ? <SkeletonLoading /> : null}

‎app/utils/get-information-from-url.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const embeddingModel = new OpenAIEmbeddings({
2020
const mistralModel = new Fireworks({
2121
modelName: "accounts/fireworks/models/mixtral-8x7b-instruct",
2222
streaming: false,
23+
maxTokens: 4096,
2324
});
2425

2526
export const get_information_from_url = async ({

‎app/utils/search-internet.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const outputParser = new StringOutputParser();
5353
const mistralModel = new Fireworks({
5454
modelName: "accounts/fireworks/models/mixtral-8x7b-instruct",
5555
streaming: false,
56+
maxTokens: 4096,
5657
});
5758

5859
const defaultResponse = async (query: string) => {

‎remix.env.d.ts renamed to ‎env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/// <reference types="@remix-run/dev" />
1+
/// <reference types="vite/client" />
22
/// <reference types="@remix-run/node" />

‎package-lock.json

+587-485
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+14-12
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
"sideEffects": false,
55
"type": "module",
66
"scripts": {
7-
"build": "remix build",
8-
"dev": "remix dev --manual",
9-
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
10-
"start": "remix-serve ./build/index.js",
11-
"typecheck": "tsc"
7+
"dev": "remix vite:dev",
8+
"build": "remix vite:build",
9+
"start": "remix-serve ./build/server/index.js"
1210
},
1311
"dependencies": {
1412
"@fontsource-variable/inter": "^5.0.16",
1513
"@heroicons/react": "^2.1.1",
1614
"@langchain/community": "^0.0.30",
1715
"@langchain/openai": "^0.0.14",
18-
"@remix-run/css-bundle": "^2.6.0",
19-
"@remix-run/node": "^2.6.0",
20-
"@remix-run/react": "^2.6.0",
21-
"@remix-run/serve": "^2.6.0",
16+
"@remix-run/css-bundle": "^2.8.1",
17+
"@remix-run/node": "^2.8.1",
18+
"@remix-run/react": "^2.8.1",
19+
"@remix-run/serve": "^2.8.1",
2220
"@supabase/ssr": "^0.1.0",
2321
"@tailwindcss/forms": "^0.5.7",
2422
"@tailwindcss/typography": "^0.5.10",
@@ -38,21 +36,25 @@
3836
"rehype-mathjax": "^6.0.0",
3937
"remark-gfm": "^4.0.0",
4038
"remark-math": "^6.0.0",
39+
"vite-tsconfig-paths": "^4.3.2",
4140
"wikipedia": "^2.1.2"
4241
},
4342
"devDependencies": {
44-
"@remix-run/dev": "^2.6.0",
43+
"@remix-run/dev": "^2.8.1",
4544
"@types/react": "^18.2.20",
4645
"@types/react-dom": "^18.2.7",
4746
"@typescript-eslint/eslint-plugin": "^6.7.4",
47+
"autoprefixer": "^10.4.19",
4848
"eslint": "^8.38.0",
4949
"eslint-import-resolver-typescript": "^3.6.1",
5050
"eslint-plugin-import": "^2.28.1",
5151
"eslint-plugin-jsx-a11y": "^6.7.1",
5252
"eslint-plugin-react": "^7.33.2",
5353
"eslint-plugin-react-hooks": "^4.6.0",
54-
"tailwindcss": "^3.4.1",
55-
"typescript": "^5.1.6"
54+
"postcss": "^8.4.38",
55+
"tailwindcss": "^3.4.3",
56+
"typescript": "^5.1.6",
57+
"vite": "^5.2.8"
5658
},
5759
"engines": {
5860
"node": ">=18.0.0"

‎postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

‎remix.config.js

-9
This file was deleted.

‎test.js

-13
This file was deleted.

‎tsconfig.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
2-
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
2+
"include": [
3+
"**/*.ts",
4+
"**/*.tsx",
5+
"**/.server/**/*.ts",
6+
"**/.server/**/*.tsx",
7+
"**/.client/**/*.ts",
8+
"**/.client/**/*.tsx"
9+
],
310
"compilerOptions": {
411
"lib": ["DOM", "DOM.Iterable", "ES2022"],
12+
"types": ["@remix-run/node", "vite/client"],
513
"isolatedModules": true,
614
"esModuleInterop": true,
715
"jsx": "react-jsx",
16+
"module": "ESNext",
817
"moduleResolution": "Bundler",
918
"resolveJsonModule": true,
1019
"target": "ES2022",
@@ -17,7 +26,7 @@
1726
"~/*": ["./app/*"]
1827
},
1928

20-
// Remix takes care of building everything in `remix build`.
29+
// Vite takes care of building everything, not tsc.
2130
"noEmit": true
2231
}
23-
}
32+
}

‎vite.config.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { vitePlugin as remix } from "@remix-run/dev";
2+
import { installGlobals } from "@remix-run/node";
3+
import { defineConfig } from "vite";
4+
import tsconfigPaths from "vite-tsconfig-paths";
5+
6+
installGlobals();
7+
8+
export default defineConfig({
9+
plugins: [remix(
10+
{
11+
ignoredRouteFiles: ["**/*.css"],
12+
}
13+
), tsconfigPaths()],
14+
server: {
15+
port: 3000
16+
}
17+
});

0 commit comments

Comments
 (0)
Please sign in to comment.