3.6 KiB
3.6 KiB
Tasks: enterprise-etl
- Change ID: enterprise-etl
- Package:
@suaveplan/etl - Date: 2026-04-24
Prerequisites (must be published to Verdaccio first)
@suaveplan/error@suaveplan/types@suaveplan/streams@suaveplan/serialize@suaveplan/retry@suaveplan/events
Tasks
1. Scaffold package
- Create
universal/data/etl/directory tree per file layout inproposal.md - Write
package.json(name@suaveplan/etl, version0.1.0,sideEffects: false, correct workspace deps and catalog externals) - Write
tsconfig.jsonextending@suaveplan/typescript-config/library.json - Write
vitest.config.tsusingcreateTestConfig()from@suaveplan/testing/config - Add package to root
turbo.jsonpipeline if not already covered by glob
2. Error codes (src/error-codes.ts)
- Define
EtlErrorCodeunion type - Call
defineCodesto register allETL.*codes with severity and retryable flags - Export
registerEtlErrorCodes()factory - Export
EtlError extends SuaveplanError<EtlErrorCode>
3. Types (src/types/common.ts)
- Define and export all public interfaces:
Pipeline,PipelineOptions,PipelineResult,PipelineStats,Source,Transform,TransformContext,Sink,ErrorHandler,ErrorAction - Export
SKIPunique symbol - Write
common.md
4. Stage implementations
- Implement
Sourceinterface and built-in sources (arraySource,generatorSource,streamSource) insrc/stages/source/ - Implement
Transforminterface and built-in transforms (mapTransform,filterTransform,validateTransform,batchTransform,flatMapTransform) insrc/stages/transform/ - Implement
Sinkinterface and built-in sinks (arraySink,nullSink,transformSink) insrc/stages/sink/ - Each feature file has co-located
.md,.types.ts,.test.ts,index.tsbarrel
5. Pipeline orchestrator (src/core/pipeline/)
- Implement
createPipelinewith stage chaining, batch processing,AbortSignalpropagation, and configurableErrorHandler - Integrate
@suaveplan/streamsReadableStream/TransformStream/WritableStreaminternally - Emit progress events via
@suaveplan/eventsbus when configured - Write
pipeline.md,pipeline.types.ts,pipeline.test.ts,index.ts
6. Retry adapter (src/utils/retry-adapter.ts)
- Wrap source/sink IO methods with
@suaveplan/retrywhenretryOptionsis provided - Write
retry-adapter.mdandretry-adapter.test.ts
7. OTel instrumentation
- Add spans, counters, histograms per
proposal.md§New additions §3
8. Tests
- Unit tests co-located with each feature module (100% coverage target)
tests/integration.test.ts— full pipeline: array source → validate → map → array sinktests/property.test.ts— fast-check properties perproposal.md§5
9. Benchmarks (src/__benchmarks__/pipeline.bench.ts)
- Implement benchmark cases per
proposal.md§6
10. Docs
- Every
.tsimplementation file has a sibling.mdwith all required sections (≥200 words, both examples) - Root
README.mdwith feature table, usage examples, API reference links
11. Pre-publish gate
bunx turbo lint typecheck test --filter=@suaveplan/etlgreenbunx turbo test:coverage --filter=@suaveplan/etl≥ 100% on touched modules
12. Publish
bun scripts/publish.ts --package @suaveplan/etl
13. Archive
- Fold spec delta into
openspec/specs/data/spec.md mv openspec/changes/enterprise-etl openspec/archive/2026-04-24-enterprise-etl