first commit

This commit is contained in:
2025-10-21 22:04:03 -06:00
commit 4e71ef9c66
36 changed files with 2271 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{
"name": "@basil/shared",
"version": "1.0.0",
"description": "Shared TypeScript types and utilities for Basil",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"dev": "tsc --watch"
},
"keywords": ["basil", "shared", "types"],
"license": "MIT",
"devDependencies": {
"typescript": "^5.3.3"
}
}

View File

@@ -0,0 +1 @@
export * from './types';

View File

@@ -0,0 +1,69 @@
export interface Recipe {
id: string;
title: string;
description?: string;
ingredients: Ingredient[];
instructions: Instruction[];
prepTime?: number; // minutes
cookTime?: number; // minutes
totalTime?: number; // minutes
servings?: number;
imageUrl?: string;
images?: string[];
sourceUrl?: string; // For imported recipes
author?: string;
cuisine?: string;
category?: string;
tags?: string[];
rating?: number;
createdAt: Date;
updatedAt: Date;
}
export interface Ingredient {
id?: string;
name: string;
amount?: string;
unit?: string;
notes?: string;
order: number;
}
export interface Instruction {
id?: string;
step: number;
text: string;
imageUrl?: string;
}
export interface RecipeImportRequest {
url: string;
}
export interface RecipeImportResponse {
recipe: Partial<Recipe>;
success: boolean;
error?: string;
}
export interface StorageConfig {
type: 'local' | 's3';
localPath?: string;
s3Bucket?: string;
s3Region?: string;
s3AccessKey?: string;
s3SecretKey?: string;
}
export interface ApiResponse<T> {
data?: T;
error?: string;
message?: string;
}
export interface PaginatedResponse<T> {
data: T[];
total: number;
page: number;
pageSize: number;
}

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}