import { defineConfig } from 'tsup';

export default defineConfig({
  // `src/adapters/mock.ts` and `src/conformance.ts` are added as separate entries
  // in later tasks (they don't exist yet). `conformance` in particular is its own
  // entry, never reachable from `index`, because it imports vitest, and bundling
  // that into the main barrel would drag a test runner into every consumer's
  // production build.
  entry: ['src/index.ts', 'src/adapters/mock.ts', 'src/adapters/mock-inbox.ts', 'src/adapters/kernel-client.ts', 'src/conformance.ts', 'src/styles.css'],
  format: ['esm'],
  // Types only for the TS entries — styles.css has no .d.ts (and tsc chokes on a .css root file).
  dts: { entry: ['src/index.ts', 'src/adapters/mock.ts', 'src/adapters/mock-inbox.ts', 'src/adapters/kernel-client.ts', 'src/conformance.ts'] },
  clean: true,
  external: ['react', 'react-dom', 'vitest', '@insignia/iios-kernel-client'],
});
