Refactor data storage to data/ folder and remove env files
- Consolidate SQLite database and file storage into `data/` directory. - Update `src/index.ts` to ensure `data` and `data/files` directories exist on startup. - Update `src/db.ts` to use hardcoded `file:./data/data.db` path. - Update `prisma.config.ts` to use absolute path to `data/data.db` for CLI compatibility. - Update `.gitignore` to ignore `data/` directory entirely. - Remove `.env.example` and `.env.test` as they are no longer needed. - Fix TS2307 typecheck error by adding `*.webp` declaration to `src/env.d.ts`.
This commit is contained in:
1 parent
bedf5670a8
commit
8270715f5b
8 files changed
+27
-28
No files matched your search
Vendored
+7
@@ -1,4 +1,11 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
declare module '*.html' {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module '*.webp' {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
@@ -19,7 +19,9 @@ export const BUILTIN_EXPRESSIONS: ExpressionItem[] = Array.from({ length: 9 }, (
|
||||
)
|
||||
|
||||
export class ExpressionService {
|
||||
async listExpressions(options: { page?: number; limit?: number } = {}): Promise<ExpressionItem[]> {
|
||||
async listExpressions(
|
||||
options: { page?: number; limit?: number } = {},
|
||||
): Promise<ExpressionItem[]> {
|
||||
const { page = 1, limit = 20 } = options
|
||||
const skip = (page - 1) * limit
|
||||
|
||||
|
||||
@@ -3,10 +3,7 @@ import { ulid } from 'ulidx'
|
||||
import { Prisma } from '../generated/prisma/client'
|
||||
|
||||
export class OutfitService {
|
||||
async listOutfits(
|
||||
options: { page?: number; limit?: number } = {},
|
||||
equipmentId?: string,
|
||||
) {
|
||||
async listOutfits(options: { page?: number; limit?: number } = {}, equipmentId?: string) {
|
||||
const { page = 1, limit = 20 } = options
|
||||
const skip = (page - 1) * limit
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ import { Backpack, Frame, Settings, Smile, Users } from 'lucide-react'
|
||||
import logo from 'public/logo.webp'
|
||||
import { Link, useLocation } from 'react-router-dom'
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
SidebarFooter,
|
||||
SidebarGroup,
|
||||
SidebarGroupContent,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
SidebarFooter,
|
||||
SidebarGroup,
|
||||
SidebarGroupContent,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from './ui/sidebar'
|
||||
|
||||
// Menu items.
|
||||
|
||||
@@ -428,10 +428,7 @@ export const CreateLookDialog: React.FC<CreateLookDialogProps> = ({
|
||||
))}
|
||||
</div>
|
||||
{/* Loading Indicator */}
|
||||
<div
|
||||
ref={poseRef}
|
||||
className="h-10 w-full flex items-center justify-center p-4"
|
||||
>
|
||||
<div ref={poseRef} className="h-10 w-full flex items-center justify-center p-4">
|
||||
{posesLoading && <Loader2 className="w-8 h-8 animate-spin text-stone-400" />}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
@@ -19,7 +19,11 @@ export const LoadOutfitDialog: React.FC<LoadOutfitDialogProps> = ({
|
||||
onOpenChange,
|
||||
onSelect,
|
||||
}) => {
|
||||
const { items: outfits, loading, ref } = useInfiniteScroll<OutfitItem>({
|
||||
const {
|
||||
items: outfits,
|
||||
loading,
|
||||
ref,
|
||||
} = useInfiniteScroll<OutfitItem>({
|
||||
fetchData: async (page, limit) => {
|
||||
const res = await client.outfits.$get({
|
||||
query: {
|
||||
|
||||
@@ -87,11 +87,7 @@ export default function Characters() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<CreateCharacterDialog
|
||||
open={createOpen}
|
||||
onOpenChange={setCreateOpen}
|
||||
onSuccess={reset}
|
||||
/>
|
||||
<CreateCharacterDialog open={createOpen} onOpenChange={setCreateOpen} onSuccess={reset} />
|
||||
<style>{`@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }`}</style>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -107,11 +107,7 @@ export default function Expressions() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<CreateExpressionDialog
|
||||
open={createOpen}
|
||||
onOpenChange={setCreateOpen}
|
||||
onSuccess={reset}
|
||||
/>
|
||||
<CreateExpressionDialog open={createOpen} onOpenChange={setCreateOpen} onSuccess={reset} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user