OpenTowniesystem_prompt.txt9 matches
107- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
108- For persistence, use Val Town SQLite or Blob storage with `import.meta.url` for keys/table names
109- **React Configuration:** When using React libraries, pin versions with `?deps=react@18.2.0,react-dom@18.2.0` and include the `@jsxImportSource` pragma
110- When facing client-side render issues, check if all React dependencies are pinned to the same version
111- **Styling:** Default to using TailwindCSS via `<script src="https://cdn.twind.style" crossorigin></script>` unless otherwise specified
112220221### Frontend Best Practices
222- Structure as a standard client-side React app
223- Use SVG for favicons (Val Town only supports text files)
224- Separate components into individual files
225- Access bootstrapped data from `window.__INITIAL_DATA__`
226- Use React 18.2.0 consistently in all imports and the `@jsxImportSource` pragma
227- Follow the React component pattern from the example project
228- Handle API calls properly with proper error catching
229247- Always run table creation before querying
2482493. **React Configuration:**
250- All React dependencies must be pinned to 18.2.0
251- Always include `@jsxImportSource https://esm.sh/react@18.2.0` at the top of React files
252- Rendering issues often come from mismatched React versions
2532544. **File Handling:**
OpenTownieREADME.md1 match
4647OpenTownie is built with:
48- React frontend with TypeScript
49- Hono API server backend
50- Tailwind CSS for styling
OpenTownieProjects.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
34// Component for the loading spinner
OpenTownieProjectFiles.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { DirectoryTree } from "./DirectoryTree.tsx";
4import { LoadingSpinner } from "./LoadingSpinner.tsx";
OpenTownieMessageTimer.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
34// Utility to format milliseconds into a readable time string
OpenTownieMessagePart.tsx8 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { type Message } from "https://esm.sh/@ai-sdk/react?dev&deps=react@18.2.0&react-dom@18.2.0";
3import ReactMarkdown from "https://esm.sh/react-markdown?dev&deps=react@18.2.0&react-dom@18.2.0";
4import { ImagePreview } from "./ImageUpload.tsx";
548// Use the triple backtick syntax for code blocks
49const codeBlock = "```" + language + "\n" + content + "\n```";
50return <ReactMarkdown>{codeBlock}</ReactMarkdown>;
51};
528788export function MessagePart({ part }: { part: NonNullable<Message["parts"]>[number] }) {
89if (part.type === "text") return <ReactMarkdown>{part.text}</ReactMarkdown>;
90if (part.type === "reasoning")
91return (
95</summary>
96<div>
97<ReactMarkdown>{part.reasoning}</ReactMarkdown>
98{part.details && part.details.map((detail, index) => (
99<div key={index} className="mt-2">
100<ReactMarkdown>{detail.text}</ReactMarkdown>
101</div>
102))}
145return (
146<div className="think-content text-lg">
147<ReactMarkdown>{args.thought}</ReactMarkdown>
148</div>
149);
OpenTownieMessageItem.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { MessagePart } from "./MessagePart.tsx";
4import { MessageTimer } from "./MessageTimer.tsx";
OpenTownieLogin.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
34export function Login() {
OpenTownieLoadingSpinner.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
34export const LoadingSpinner = () => (
OpenTownieindex.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?dev";
3import { App } from "./components/App.tsx";
4