Skip to content

chore(repo): create shared utils package with toError helper #73

@zrosenbauer

Description

@zrosenbauer

Summary

Multiple packages duplicate the instanceof Errornew Error(String(...)) coercion pattern inline. The @zpress/cli package already has a toError utility (packages/cli/src/lib/error.ts), but other packages (config, core) use inline variants.

Proposal

  • Create a shared @zpress/utils package (or similar) with common helpers like toError
  • Replace all inline instanceof Error coercion patterns across packages with the shared util
  • Consolidate any other duplicated utility patterns discovered along the way

Locations

  • packages/config/src/loader.ts:118
  • packages/config/scripts/generate-schema.ts:53
  • packages/core/src/banner/index.ts:184
  • packages/cli/src/commands/diff.ts:349
  • packages/cli/src/lib/error.ts (existing util to promote)

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