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
Background
politty generate-shim(#633) derives its arguments frompackage.json: the output path from thebinpaths, the program name from thebinnames, and the entry from conventional built modules. Its sibling build-time commandpolitty generate-workerstill requires--binand--programto be passed explicitly, so the two commands now have different setup ergonomics.Proposal
Bring
generate-workerin line withgenerate-shim:--program: default to the firstbinname in the nearestpackage.json(falling back to the package name without its scope).--bin: default to the firstbinpath (the built entry the worker should invoke — note that once a compile-cache shim is in place,binpoints at the shim, which is also a valid target).--shell: consider allowing repeats or anallvalue so one invocation can generate bash/zsh/fish workers in a singlepostbuildscript.Notes