Skip to content

refactor: consolidate view packages to shared #16

@rianjs

Description

@rianjs

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

  1. Add cfl's RenderList(), RenderKeyValue(), and ListMeta/ListResponse types to shared/view/
  2. Delete tools/cfl/internal/view/view.go
  3. Delete tools/jtk/internal/view/view.go
  4. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions