diff --git a/README.md b/README.md index fffca0b..12cad0a 100644 --- a/README.md +++ b/README.md @@ -43,32 +43,34 @@ This all-in-one command makes OAuth development seamless. ```bash # Build commands -pnpm build # Build frontend first, then backend -pnpm build:appview # Build only the backend -pnpm build:client # Build only the frontend +pnpm build # Build in correct order: lexicon → client → appview +pnpm build:lexicon # Build only the lexicon package (type definitions) +pnpm build:client # Build only the frontend +pnpm build:appview # Build only the backend # Start commands -pnpm start # Start the server (serves API and frontend) -pnpm start:client # Start frontend development server only -pnpm start:dev # Start both backend and frontend separately (development only) +pnpm start # Start the server (serves API and frontend) +pnpm start:client # Start frontend development server only +pnpm start:dev # Start both backend and frontend separately (development only) # Other utilities -pnpm typecheck # Run type checking -pnpm format # Format all code +pnpm typecheck # Run type checking +pnpm format # Format all code ``` ## Deployment For production deployment: -1. Build both packages: +1. Build all packages in the correct order: ```bash pnpm build ``` This will: - - Build the frontend (`packages/client`) first - - Then build the backend (`packages/appview`) + - Build the lexicon package first (shared type definitions) + - Build the frontend (`packages/client`) next + - Finally build the backend (`packages/appview`) 2. Start the server: ```bash diff --git a/package.json b/package.json index 55603c7..794762b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dev:oauth": "node scripts/setup-ngrok.js", "lexgen": "pnpm --filter @statusphere/lexicon build", - "build": "pnpm build:client && pnpm build:appview", + "build": "pnpm build:lexicon && pnpm build:client && pnpm build:appview", + "build:lexicon": "pnpm --filter @statusphere/lexicon build", "build:appview": "pnpm --filter @statusphere/appview build", "build:client": "pnpm --filter @statusphere/client build", diff --git a/packages/lexicon/package.json b/packages/lexicon/package.json index 8c084c6..65c5343 100644 --- a/packages/lexicon/package.json +++ b/packages/lexicon/package.json @@ -12,7 +12,8 @@ "dev": "tsup --watch", "clean": "rimraf dist", "typecheck": "tsc --noEmit", - "lexgen": "lex gen-api ./src ../../lexicons/xyz/statusphere/* ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* --yes" + "lexgen": "lex gen-api ./src ../../lexicons/xyz/statusphere/* ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* --yes", + "postinstall": "pnpm run build" }, "dependencies": { "@atproto/api": "^0.14.7",