Skip to content

Consider creating separate modules for library and CLI #48

@achou11

Description

@achou11

Even if a consuming library/project only uses this package programmatically (i.e. no CLI usage), all of the CLI-specific deps are still pulled in and added to the consumer's deps graph unnecessarily, adding significant installation and maintenance overhead.

Ideally, the programmatic API is implemented as a separate package and the CLI then uses that package for its needs and published separately. While this creates the relatively small overhead of managing two projects, it results in a massive improvement for the consuming experience.

For example, @comapeo/core only uses the programmatic API but anything that uses @comapeo/core will be pulling in deps that are related to the CLI functionality of styled-map-package, which is currently non-trivial:

https://pkg-size.dev/styled-map-package@3.0.0

https://pkg-graph.info/styled-map-package@3.0.0

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