The recipes.blue monorepo recipes.blue
recipes appview atproto

feat: update all code to use new lexicons naming

+23 -23
+3 -3
apps/api/src/auth/index.ts
··· 3 3 import { getClient } from "./client.js"; 4 4 import { z } from "zod"; 5 5 import { Session } from "hono-sessions"; 6 - import { CookwareSession, getSessionAgent } from "../util/api.js"; 6 + import { RecipesSession, getSessionAgent } from "../util/api.js"; 7 7 8 8 export const authApp = new Hono<{ 9 9 Variables: { 10 - session: Session<CookwareSession>, 10 + session: Session<RecipesSession>, 11 11 session_key_rotation: boolean, 12 12 }, 13 13 }>(); ··· 64 64 const params = new URLSearchParams(ctx.req.url.split('?')[1]); 65 65 66 66 const { session } = await client.callback(params); 67 - const currentSession = ctx.get('session') as Session<CookwareSession>; 67 + const currentSession = ctx.get('session') as Session<RecipesSession>; 68 68 const did = currentSession.get('did'); 69 69 if (did) { 70 70 ctx.status(400);
+4 -4
apps/api/src/index.ts
··· 7 7 import { authApp } from "./auth/index.js"; 8 8 import { ZodError } from "zod"; 9 9 import { CookieStore, Session, sessionMiddleware } from "hono-sessions"; 10 - import { CookwareSession } from "./util/api.js"; 10 + import { RecipesSession } from "./util/api.js"; 11 11 import * as Sentry from "@sentry/node" 12 12 import { readFileSync } from "fs"; 13 13 import { getFilePathWithoutDefaultDocument } from "hono/utils/filepath"; ··· 21 21 22 22 const app = new Hono<{ 23 23 Variables: { 24 - session: Session<CookwareSession>, 24 + session: Session<RecipesSession>, 25 25 session_key_rotation: boolean, 26 26 }, 27 27 }>(); 28 28 29 29 const store = new CookieStore({ 30 - sessionCookieName: 'cookware-session', 30 + sessionCookieName: 'recipes-session', 31 31 }); 32 32 33 33 app.use(async (c, next) => { ··· 59 59 } 60 60 return env.CORS_ORIGINS.includes(origin) 61 61 ? origin 62 - : 'https://cookware.hayden.moe'; 62 + : 'https://recipes.blue'; 63 63 }, 64 64 allowHeaders: ['Content-Type', 'Accept'], 65 65 allowMethods: ['POST', 'GET', 'OPTIONS'],
+3 -3
apps/api/src/logger.ts
··· 1 1 import { pino } from "pino"; 2 2 3 - export const rootLogger = pino({ name: 'cookware' }); 4 - export const apiLogger = pino({ name: 'cookware.api' }); 5 - export const authLogger = pino({ name: 'cookware.auth' }); 3 + export const rootLogger = pino({ name: 'recipes' }); 4 + export const apiLogger = pino({ name: 'recipes.api' }); 5 + export const authLogger = pino({ name: 'recipes.auth' });
+2 -2
apps/api/src/util/api.ts
··· 4 4 import { Agent } from "@atproto/api"; 5 5 import { authLogger } from "../logger.js"; 6 6 7 - export type CookwareSession = { did: string; }; 7 + export type RecipesSession = { did: string; }; 8 8 9 9 export const getSessionAgent = async (ctx: Context) => { 10 10 const client = await getClient(ctx); 11 - const session = ctx.get('session') as Session<CookwareSession>; 11 + const session = ctx.get('session') as Session<RecipesSession>; 12 12 const did = session.get('did'); 13 13 if (!did) return null; 14 14
+3 -3
apps/api/src/xrpc/index.ts
··· 1 1 import { Hono } from 'hono'; 2 2 import { db, recipeTable } from '@cookware/database'; 3 3 import { and, desc, eq, sql } from 'drizzle-orm'; 4 - import { DID, getDidDoc, getDidFromHandleOrDid, parseDid } from '@cookware/lexicons'; 4 + import { DID, getDidDoc, getDidFromHandleOrDid } from '@cookware/lexicons'; 5 5 6 6 export const xrpcApp = new Hono(); 7 7 8 - xrpcApp.get('/moe.hayden.cookware.getRecipes', async ctx => { 8 + xrpcApp.get('/blue.recipes.feed.getRecipes', async ctx => { 9 9 const { did: didQuery } = ctx.req.query(); 10 10 11 11 let did: DID | null = null; ··· 50 50 }); 51 51 }); 52 52 53 - xrpcApp.get('/moe.hayden.cookware.getRecipe', async ctx => { 53 + xrpcApp.get('/blue.recipes.feed.getRecipe', async ctx => { 54 54 const { did, rkey } = ctx.req.query(); 55 55 if (!did) throw new Error('Invalid DID'); 56 56 if (!rkey) throw new Error('Invalid rkey');
+2 -2
apps/ingester/src/index.ts
··· 10 10 const jetstream = new Jetstream({ 11 11 ws: WebSocket, 12 12 endpoint: env.JETSTREAM_ENDPOINT, 13 - wantedCollections: ['moe.hayden.cookware.*'], 13 + wantedCollections: ['blue.recipes.*'], 14 14 cursor: 0, 15 15 }); 16 16 ··· 66 66 jetstream.on('open', () => { 67 67 ingestLogger.info({ 68 68 endpoint: env.JETSTREAM_ENDPOINT, 69 - wantedCollections: ['moe.hayden.cookware.*'], 69 + wantedCollections: ['recipes.blue.*'], 70 70 }, 'Ingester connection opened.'); 71 71 }); 72 72
+2 -2
apps/ingester/src/logger.ts
··· 1 1 import { pino } from "pino"; 2 2 3 - export const rootLogger = pino({ name: 'cookware' }); 4 - export const ingestLogger = pino({ name: 'cookware.ingest' }); 3 + export const rootLogger = pino({ name: 'recipes' }); 4 + export const ingestLogger = pino({ name: 'recipes.ingest' });
+1 -1
apps/web/src/components/sidebar-title.tsx
··· 13 13 <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground"> 14 14 <CookingPot className="size-4" /> 15 15 </div> 16 - <span className="font-semibold text-sm flex-1 text-left leading-tight">Cookware</span> 16 + <span className="font-semibold text-sm flex-1 text-left leading-tight">Recipes</span> 17 17 </div> 18 18 </SidebarMenuItem> 19 19 </SidebarMenu>
+2 -2
apps/web/src/queries/recipe.ts
··· 15 15 return useQuery({ 16 16 queryKey: RQKEY(cursor, did ?? '', ''), 17 17 queryFn: async () => { 18 - const res = await rpc.get('moe.hayden.cookware.getRecipes', { 18 + const res = await rpc.get('blue.recipes.feed.getRecipes', { 19 19 params: { cursor, did }, 20 20 }); 21 21 return res.data; ··· 28 28 queryKey: RQKEY('', did, rkey), 29 29 queryFn: async () => { 30 30 try { 31 - const res = await rpc.get('moe.hayden.cookware.getRecipe', { 31 + const res = await rpc.get('blue.recipes.feed.getRecipe', { 32 32 params: { did, rkey }, 33 33 }); 34 34 return res.data;
+1 -1
libs/lexicons/src/recipe.ts
··· 1 1 import { z } from 'zod'; 2 2 import { IngredientObject, StepObject } from './defs.js'; 3 3 4 - export const RecipeCollection = 'moe.hayden.cookware.recipe' as const; 4 + export const RecipeCollection = 'blue.recipes.feed.recipe' as const; 5 5 6 6 export const RecipeRecord = z.object({ 7 7 title: z.string().max(3000, 'Recipe titles must be under 3000 characters.'),