mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
32 lines
731 B
TypeScript
32 lines
731 B
TypeScript
import { defineConfig } from 'tsdown';
|
|
import fs from 'node:fs/promises';
|
|
import { createConfigSchema } from './src/config.ts';
|
|
import { z } from 'zod';
|
|
|
|
export default defineConfig({
|
|
entry: ['./src/{index,config}.ts', './src/registry/installer.ts'],
|
|
format: 'esm',
|
|
dts: true,
|
|
fixedExtension: false,
|
|
target: 'node22',
|
|
deps: {
|
|
onlyBundle: [],
|
|
},
|
|
exports: {
|
|
enabled: true,
|
|
exclude: ['./index'],
|
|
},
|
|
async onSuccess() {
|
|
console.log('JSON schema generated');
|
|
await fs.mkdir('dist/schema', { recursive: true });
|
|
await fs.writeFile(
|
|
'dist/schema.json',
|
|
JSON.stringify(
|
|
z.toJSONSchema(await createConfigSchema(), {
|
|
io: 'input',
|
|
}),
|
|
),
|
|
);
|
|
},
|
|
});
|