Skip to content

Conversation

@braden-w
Copy link
Member

This refactors the transformation schema definitions to be cleaner and more maintainable, without changing any actual schema shapes or migration behavior.

The original structure used shared "Base" types (TransformationStepBase, TransformationBase) that both V1 and V2 derived from. This was defensive design for a hypothetical V3 that might need different base fields, but added unnecessary indirection.

The new structure uses direct inheritance: V1 defines all fields inline, V2 extends V1 via .merge(). This reads more naturally and follows YAGNI. The file is also split into transformation-steps.ts and transformations.ts to separate concerns.

Changes:

  • Split into two files matching the domain model (steps vs containers)
  • Remove TransformationStepBase: V1 now defines all fields directly, V2 extends V1
  • Remove TransformationBase: TransformationV1 defines container + steps, V2 extends V1
  • TransformationV1 is now an arktype validator (was plain TypeScript type)
  • Factory functions return alias types (Transformation, TransformationStep) instead of explicit V2
  • Inline migrateStepV1ToV2 function into the .pipe() callback

Verified that all schema shapes and migration behavior are unchanged.

…eritance

- Split transformation-steps.ts and transformations.ts
- Remove TransformationStepBase: V1 defines all fields, V2 extends V1
- Remove TransformationBase: V1 defines container + steps, V2 extends V1
- TransformationV1 is now arktype validator (was plain TS type)
- Factory functions return alias types (Transformation, TransformationStep)
- Inline migrateStepV1ToV2 into .pipe() callback

Schema shapes and migration behavior unchanged.
@github-actions
Copy link
Contributor

🚀 Preview Deployment Ready!

Whispering Preview: https://whispering-pr-1143.epicenter.workers.dev

Worker Name: whispering-pr-1143

This preview will be automatically updated with new commits to this PR.


Built with commit 5d432f7

@braden-w braden-w merged commit 2fc676d into main Dec 15, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants