3.9 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level |
|---|---|---|---|---|---|---|---|
| build-and-exports-validation | Validate build, package.json exports, and tsup config for all adapters | completed | narrow | low | component | 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:
- An entry in
tsup.config.tsentry array - A sub-path export in
package.jsonexports map (ESM + CJS + declarations) - 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 buildproduces correct output for existing entry points (index, event-target-redis)npm run lint(tsc --noEmit) passespackage.jsonexports map has correct ESM/CJS/dts paths for each entry pointtsup.config.tslists all current entry pointssrc/index.tsre-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
-
npm run buildproduces 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 (
chunk-JGLUDY7D.js/chunk-TBKAZXTS.cjs) - Verified both ESM dynamic import and CJS require work for both entry points
-
npm run lint(tsc --noEmit) passes ✅ — No errors -
package.jsonexports map has correct ESM/CJS/dts paths ✅"."→ import (d.ts + js) / require (d.cts + cjs)"./event-target-redis"→ import (d.ts + js) / require (d.cts + cjs)- All paths resolve to actual built files
-
tsup.config.tslists all current entry points ✅src/index.tsandsrc/event-target-redis.tsboth presentformat: ['esm', 'cjs'],dts: true,splitting: true,target: 'es2022'
-
src/index.tsre-exports everything from all modules ✅- Exports from:
create_pubsub.js,types.js,operators.js,repeater.js,event-target-redis.js - All public API surface is accessible from barrel
- Exports from:
-
Peer dependencies and peerDependenciesMeta are correct ✅
ioredis@^5.0.0as optional peer dep- Future:
@rayhanadev/irohwill follow same pattern when added
-
No runtime dependencies ✅
dependencies: {}is empty@repeaterjs/repeateris inlined insrc/repeater.ts
Verified type resolution
import { createRedisEventTarget } from '@alkdev/pubsub/event-target-redis'— types resolve correctlyimport { createPubSub, type EventEnvelope } from '@alkdev/pubsub'— types resolve correctly- Works with both
skipLibCheck: trueandskipLibCheck: false
Verified package contents
npm pack --dry-runshows 19 files (all dist files + package.json)files: ["dist"]correctly includes all build output
Summary
Validated build pipeline, package.json exports map, and tsup config for all adapters. All acceptance criteria pass with no changes required — the existing configuration is correct and consistent.
- Created: none
- Modified: none (validation-only task)
- Tests: 0 (no test files exist yet;
npm testexits with "No test files found")