mirror of
https://github.com/hanzoai/mdx.git
synced 2026-10-30 18:28:01 +00:00
Builds on the preserved WIP commit (f8d7b8d).
@hanzo/mdx is MDX *processing*: remark/MDX loaders plus the
next/vite/webpack/bun/node adapters. The `./components` barrel re-exported
`@hanzo/ui/content`, `@hanzo/ui/docs/components` and `@hanzo/ui/docs/mdx` —
entry points that do not exist in @hanzo/ui 8.x, so the dts build failed with
five TS2307s. The only 8.x-shaped home for those docs components is
@hanzo/docs-ui, which is radix + tailwind-merge + cva; re-pointing at it would
have dragged exactly what 8.x removes back into the tree.
Deleted instead. Components belong to the component layer (@hanzo/ui 8.x on
@hanzo/gui); this package now has no React surface and no component library
dependency at all — zero tailwind/radix/shadcn in the resolved tree.
Also:
- Generated `.source` index imported `@hanzo/docs/mdx/runtime/*` (the legacy
monolith) while the type import already said `@hanzo/mdx/runtime/types`.
Both now resolve to this package's own `./runtime/*` entries.
- src/loaders/adapter.ts typed ViteLoader.transform with vite's
TransformResult, but the vite plugin hook consumes rollup's; and rollup's
own SourceMap is not assignable to its SourceMapInput. Both fixed. This was
masked by the earlier module-resolution failure, not introduced here.
- Regenerated the five index fixtures — still upstream `fumadocs-mdx/*` and
monorepo `packages/mdx/test/fixtures/*` paths from before the fork/extract.
- MDXPresetOptions default preset literal 'fumadocs' -> 'hanzo' (no consumer
in ~/work used it explicitly).
TS7 correction: removed @typescript/native-preview (7.0.0-dev, behind stable)
and reverted types:check to `tsc --noEmit`. This package builds with tsup, so
it stays on typescript 5.x.
Verified: pnpm build / test / types:check all exit 0 (8/8 tests).
Co-authored-by: Hanzo Dev <[email protected]>
39 lines
740 B
TypeScript
39 lines
740 B
TypeScript
import { defineConfig } from 'tsup';
|
|
|
|
const external = [
|
|
'next',
|
|
'typescript',
|
|
'bun',
|
|
/^@hanzo\/docs/,
|
|
'@hanzo/docs-core',
|
|
'@hanzo/mdx-runtime',
|
|
];
|
|
|
|
export default defineConfig([
|
|
{
|
|
entry: [
|
|
'./src/{index,bin}.ts',
|
|
'./src/{config,next,vite,bun}/index.ts',
|
|
'./src/webpack/{mdx,meta}.ts',
|
|
'./src/node/loader.ts',
|
|
'./src/runtime/*.ts',
|
|
'./src/plugins/*.ts',
|
|
],
|
|
format: 'esm',
|
|
external,
|
|
dts: true,
|
|
target: 'node22',
|
|
},
|
|
{
|
|
entry: {
|
|
// ensure Next.js CJS config compatibility
|
|
// because next.config.ts by default uses CJS
|
|
'./next/index': './src/next/index.ts',
|
|
},
|
|
format: 'cjs',
|
|
external,
|
|
dts: false,
|
|
target: 'node22',
|
|
},
|
|
]);
|