Skip to content

Development

This repository is a pnpm workspace:

PathPurpose
packages/astro-chatty-gptThe published integration (tsup → dist/)
playgroundStarlight docs site + integration demo
RootShared scripts, Biome, Changesets
  • Node.js 22.15+ (see .nvmrc)
  • pnpm 10+ (corepack enable recommended)
Terminal window
pnpm install

Build the integration package (required before the playground can load it):

Terminal window
pnpm package:build
CommandDescription
pnpm devWatch package + run playground dev server in parallel
pnpm package:devWatch packages/astro-chatty-gpt with tsup
pnpm playground:devAstro dev server (Starlight docs)
pnpm package:buildOne-off package build
pnpm playground:buildastro check + production build + Upstash indexing
pnpm playground:checkType-check playground only
pnpm lintBiome check across the repo

The playground uses Astro 6, Starlight 0.39+, Tailwind 4.3, and @astrojs/netlify 7 with HMR for the integration via astro-integration-kit.

Copy credentials into playground/.env:

UPSTASH_SEARCH_REST_URL=...
UPSTASH_SEARCH_REST_TOKEN=...
OPENAI_API_KEY=...

Use the dev server — astro preview is not supported with @astrojs/netlify v7:

Terminal window
pnpm playground:dev

Then test:

  • GET http://localhost:4321/api/search?q=installation
  • POST http://localhost:4321/api/chatbot with JSON body
  • Check Upstash REST URL and token in .env
  • Confirm the Search database is active in the Upstash console
  • Run pnpm playground:build (or astro build) so content is indexed
  • Review excludeRoutes and excludeTags in astro.config
  • Ensure contentTag matches your HTML (default: main)
  • Set site in astro.config
  • Provide all three env vars (UPSTASH_* + OPENAI_API_KEY for chat; indexing only needs Upstash)
  • Check build logs for [astro-chatty-gpt] messages

Restart the playground dev server after editing packages/astro-chatty-gpt source, or rely on pnpm dev which watches both.