Skip to content

feat(cli): derive generate-worker arguments from package.json like generate-shim #634

Description

@toiroakr

Background

politty generate-shim (#633) derives its arguments from package.json: the output path from the bin paths, the program name from the bin names, and the entry from conventional built modules. Its sibling build-time command politty generate-worker still requires --bin and --program to be passed explicitly, so the two commands now have different setup ergonomics.

Proposal

Bring generate-worker in line with generate-shim:

  • --program: default to the first bin name in the nearest package.json (falling back to the package name without its scope).
  • --bin: default to the first bin path (the built entry the worker should invoke — note that once a compile-cache shim is in place, bin points at the shim, which is also a valid target).
  • --shell: consider allowing repeats or an all value so one invocation can generate bash/zsh/fish workers in a single postbuild script.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions