Summary
Consolidate the three separate view package implementations into the shared package.
Current State
There are THREE view implementations with overlapping functionality:
shared/view/view.go (210 lines) - has Table(), JSON(), Plain(), Render(), Success(), Error(), Warning(), Info(), Truncate()
tools/cfl/internal/view/view.go (227 lines) - similar methods plus RenderList(), RenderKeyValue(), ListMeta/ListResponse types
tools/jtk/internal/view/view.go (131 lines) - simpler version
The Truncate() function alone is duplicated in all three locations.
Proposed Changes
- Add cfl's
RenderList(), RenderKeyValue(), and ListMeta/ListResponse types to shared/view/
- Delete
tools/cfl/internal/view/view.go
- Delete
tools/jtk/internal/view/view.go
- Update all imports to use
github.com/open-cli-collective/atlassian-go/view
Impact
~350 lines removed, 4 files changed
Naming
Standardize on View type name (currently cfl uses Renderer, jtk uses View).
Summary
Consolidate the three separate view package implementations into the shared package.
Current State
There are THREE view implementations with overlapping functionality:
shared/view/view.go(210 lines) - hasTable(),JSON(),Plain(),Render(),Success(),Error(),Warning(),Info(),Truncate()tools/cfl/internal/view/view.go(227 lines) - similar methods plusRenderList(),RenderKeyValue(),ListMeta/ListResponsetypestools/jtk/internal/view/view.go(131 lines) - simpler versionThe
Truncate()function alone is duplicated in all three locations.Proposed Changes
RenderList(),RenderKeyValue(), andListMeta/ListResponsetypes toshared/view/tools/cfl/internal/view/view.gotools/jtk/internal/view/view.gogithub.com/open-cli-collective/atlassian-go/viewImpact
~350 lines removed, 4 files changed
Naming
Standardize on
Viewtype name (currently cfl usesRenderer, jtk usesView).