Files
deepseek-harness/tsdown.config.ts
Tianyi Cui a2d0f7f411 refactor: apply repository naming contract
Apply the accepted pre-release package, service, type, directory, and role renames as one repository-wide change.
2026-08-13 00:54:38 +08:00

31 lines
1.1 KiB
TypeScript

import { defineConfig } from 'tsdown'
import { typertPlugin } from './packages/typert/generator/lib/types/tsdown-plugin.js'
function isBuildFaceClient(value: unknown): boolean {
if (value === undefined || value === 'host') return false
if (value === 'client') return true
throw new Error(`tsdown: --env.DSH_BUILD_FACE must be host or client, received ${String(value)}`)
}
/**
* The ordinary workspace build consumes JavaScript emitted by the Host
* TypeScript project and runs Typert. The Client pass selects packages that
* declare a browser bundle and lets their package-local configs emit both
* their Node loader entry and browser artifact.
*/
export default defineConfig(({ env }) => {
const client = isBuildFaceClient(env?.DSH_BUILD_FACE)
return {
workspace: ['vendor/*', 'packages/*/*', 'apps/cli'],
entry: client ? '' : ['lib/types/{index,invariant,startup}.js'],
outDir: 'lib',
format: ['esm'],
platform: 'node',
target: 'es2024',
fixedExtension: false,
dts: false,
clean: false,
plugins: client ? [] : [typertPlugin({ mode: 'workspace', faces: ['host'] })],
}
})