This guide covers how to set up and work on @mintlify/astro locally.
- Clone the repository:
git clone https://github.com/mintlify/astro.git
cd astro- Install dependencies:
npm installBuild the package:
npm run buildThis runs the TypeScript compiler to produce output in dist/.
Run type checks without emitting files:
npm run typeFormat all files with Prettier:
npm run formatsrc/
├── index.ts # Astro integration entry point
├── components.ts # MDX component exports
├── helpers.ts # Navigation and page data helpers
├── types.ts # Shared type definitions
└── utils/
├── clear-content-directory.ts
├── copy-assets.ts
├── extract-react-components.ts
├── find-user-components.ts
├── load-all-snippets.ts
├── logger.ts
├── mintlify-components.tsx
├── read-docs-config.ts
├── read-page-content.ts
├── resolve-snippets.ts
├── serve-docs-assets.ts
├── static-assets.ts
├── write-page-content.ts
└── write-raw-md.ts
index.ts— The main Astro integration. Hooks intoastro:config:setupto sync docs content into.mintlify/content collections,astro:server:setupto serve static assets in dev, andastro:build:doneto copy assets to the output directory.components.ts— Re-exports the MDX component map from@mintlify/componentsfor use in Astro pages.helpers.ts— Navigation helpers for decorating raw navigation config, resolving sidebar entries, tabs, footer pages, and favicons.
To test local changes in a consuming Astro project, you can use yalc:
# In this repo
npx yalc publish
# In your Astro project
npx yalc add @mintlify/astro
npm install