You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a new option is added, existing programmatic integrations can break unless they explicitly set that option, since the user may be prompted for input (and there might not even be a user!)
In programmatic scenarios, create-package-json should never prompt the user. It should have defaults for everything, unless there is anything that is truly required, in which case it should throw an error if it's missing
changed the title [-]bug: create-package-json should never prompt when invoked programmatically[/-][+]bug: never prompt when invoked programmatically[/+]on Dec 19, 2025
The ideal here IMO is to decouple the methods that are exposed into three categories:
High level workflows. This would be the only one that directly does anything regarding collecting user input.
Two mid-tier apis: read & write for composition into other workflows (what we should have been using)
Building blocks: low level individual api's for more advanced use.
Since I have been touching this stuff again I have been considering what the next (unfortunately breaking) changes should look like, and I think I need to start with a new major in opta to address some of the underlying design choices for api composition that were made there. In general I think the idea is still solid (basic JS composition/POJO configuration with opinionated merging of cli/programitic/prompt input), but it needs to solve for 2 specific things:
Improved options composition. Which is the main issue reported here, but additionally it needs to better support composing them across sub-commands within single projects.
Helpers and ergonomic APIs for implementor DX. There are a bunch of patterns I have seen in using this that can meaningfully clean up these rough edges. I need to open an issue to enumerate them, so I will do that as soon as I can.
So, all this to say that I think the changes this package requires mean a new major and I think we need to do a major under the hood to best achieve that here. If we want we can skip it and do two majors (one to fix these apis, and one to update the foundation) but I doubt that will happen unless someone has more time to work on this than I have over the years.
Activity
[-]bug: create-package-json should never prompt when invoked programmatically[/-][+]bug: never prompt when invoked programmatically[/+][-]bug: never prompt when invoked programmatically[/-][+]bug: prompting when invoked programmatically[/+]wesleytodd commentedon Jan 8, 2026
The ideal here IMO is to decouple the methods that are exposed into three categories:
read&writefor composition into other workflows (what we should have been using)Since I have been touching this stuff again I have been considering what the next (unfortunately breaking) changes should look like, and I think I need to start with a new major in
optato address some of the underlying design choices for api composition that were made there. In general I think the idea is still solid (basic JS composition/POJO configuration with opinionated merging of cli/programitic/prompt input), but it needs to solve for 2 specific things:So, all this to say that I think the changes this package requires mean a new major and I think we need to do a major under the hood to best achieve that here. If we want we can skip it and do two majors (one to fix these apis, and one to update the foundation) but I doubt that will happen unless someone has more time to work on this than I have over the years.