--- id: build-and-exports-validation name: Validate build, package.json exports, and tsup config for all adapters status: completed depends_on: [] scope: narrow risk: low impact: component level: implementation --- ## Description Verify that the build pipeline correctly produces dual ESM + CJS output with declarations for all entry points, and that `package.json` exports map and `tsup.config.ts` entries are consistent. Currently only `src/index.ts` and `src/event-target-redis.ts` are entry points. As new adapters are added, each needs: 1. An entry in `tsup.config.ts` entry array 2. A sub-path export in `package.json` exports map (ESM + CJS + declarations) 3. A barrel re-export in `src/index.ts` This task validates the current setup and serves as a checklist item for each adapter task. It can be done early and re-verified as adapters are added. ## Acceptance Criteria - [ ] `npm run build` produces correct output for existing entry points (index, event-target-redis) - [ ] `npm run lint` (tsc --noEmit) passes - [ ] `package.json` exports map has correct ESM/CJS/dts paths for each entry point - [ ] `tsup.config.ts` lists all current entry points - [ ] `src/index.ts` re-exports everything from all modules - [ ] Peer dependencies and peerDependenciesMeta are correct - [ ] No runtime dependencies (Repeater is inlined) ## References - docs/architecture/build-distribution.md - package.json - tsup.config.ts ## Notes Validated all acceptance criteria. No changes were needed — the existing configuration is correct. ### Validation Results 1. **`npm run build` produces correct output** ✅ - `src/index.ts` → `dist/index.js` (ESM), `dist/index.cjs` (CJS), `dist/index.d.ts` + `dist/index.d.cts` (declarations) - `src/event-target-redis.ts` → `dist/event-target-redis.js` (ESM), `dist/event-target-redis.cjs` (CJS), `dist/event-target-redis.d.ts` + `dist/event-target-redis.d.cts` (declarations) - Code splitting enabled: shared chunk between entries - Verified both ESM dynamic import and CJS require work for both entry points 2. **`npm run lint` (tsc --noEmit) passes** ✅ 3. **`package.json` exports map has correct ESM/CJS/dts paths** ✅ 4. **`tsup.config.ts` lists all current entry points** ✅ 5. **`src/index.ts` re-exports everything from all modules** ✅ 6. **Peer dependencies and peerDependenciesMeta are correct** ✅ 7. **No runtime dependencies** ✅ ### Verified type resolution - Sub-path and barrel imports resolve correctly with tsc - Works with both skipLibCheck true and false ### Verified package contents - `npm pack --dry-run` shows 19 files (all dist files + package.json) ## Summary Validated build pipeline, package.json exports map, and tsup config for all adapters. All acceptance criteria pass with no changes required. - Created: none - Modified: tasks/016-build-and-exports-validation.md (status update only) - Tests: 0 (no test files exist yet)