Files
docs/packages/hanzo-docs/tsup.config.ts
zeekay 7b1a35dc5b fix(ci): improve workflow with Bun setup and reliable DTS generation
Use tsc --emitDeclarationOnly instead of tsup dts for more reliable
type declaration generation. Add Bun setup step needed by zap-docs
pre/post build scripts.
2026-02-08 23:05:49 -08:00

68 lines
1.6 KiB
TypeScript

import { defineConfig } from 'tsup';
import { readdirSync, statSync } from 'fs';
import { join } from 'path';
function getEntries(dir: string, base = ''): Record<string, string> {
const entries: Record<string, string> = {};
const items = readdirSync(dir);
for (const item of items) {
const fullPath = join(dir, item);
const relativePath = base ? `${base}/${item}` : item;
if (statSync(fullPath).isDirectory()) {
Object.assign(entries, getEntries(fullPath, relativePath));
} else if (item.endsWith('.ts') && !item.endsWith('.d.ts')) {
const name = relativePath.replace(/\.ts$/, '');
entries[name] = fullPath;
}
}
return entries;
}
const entries = getEntries('./src');
export default defineConfig({
entry: entries,
format: ['esm'],
dts: false,
splitting: false,
clean: true,
external: [
// Core packages (we re-export from these)
'@hanzo/docs-core',
'@hanzo/docs-mdx',
'@hanzo/docs-base-ui',
'@hanzo/docs-ui',
'@hanzo/docs-openapi',
'@hanzo/docs-twoslash',
'@hanzo/docs-obsidian',
'@hanzo/docs-mdx-remote',
'@hanzo/docs-cli',
// Hanzo packages (peer dependencies)
'@hanzo/ui',
'@hanzo/mdx',
'@hanzo/docs-typescript',
'@hanzo/docs-docgen',
'@hanzo/docs-python',
'@hanzo/docs-content-collections',
'@hanzo/docs-press',
'@hanzo/mdx-runtime',
// React ecosystem
'react',
'react-dom',
'next',
// Optional integrations
'algoliasearch',
'@orama/orama',
'@orama/core',
'@oramacloud/client',
'@tanstack/react-router',
'react-router',
'waku',
'zod',
'lucide-react'
],
});