Files
docs/packages/zenlm-ui/tsup.config.ts
zeekay d68fde9f06 restore(@zenlm/ui): add package source with perfect circle SVG and use client
Restore full @zenlm/ui package source recovered from git history (924614b46).
Key changes from restored version:
- ZenEnso uses SVG <circle> element (r=172, cx/cy=256) — mathematically perfect
- stroke-dasharray=1081 (2π×172) for exact circumference animation
- rotate(-90 256 256) starts draw from 12 o'clock
- Default color: white (was #A855F7)
- tsup onSuccess hook injects 'use client' into all dist files post-build
- Published as @zenlm/[email protected] on npm
2026-03-01 16:19:34 -08:00

23 lines
696 B
TypeScript

import { defineConfig } from 'tsup'
import { glob } from 'glob'
export default defineConfig({
entry: { 'index': 'src/index.ts' },
format: ['esm', 'cjs'],
dts: true,
clean: true,
treeshake: true,
sourcemap: true,
external: ['react', 'react-dom', 'lucide-react', '@zenlm/models'],
onSuccess: async () => {
const fs = (await import('fs')).default
const files = glob.sync('dist/**/*.{js,cjs}', { ignore: ['**/*.d.*'] })
for (const file of files) {
const content = fs.readFileSync(file, 'utf-8')
if (!content.startsWith('"use client"') && !content.startsWith("'use client'")) {
fs.writeFileSync(file, '"use client";\n' + content)
}
}
},
})