oclif / plugin-commands

MIT License
8 stars 3 forks source link

fix: correctly merge command class prototypes #765

Closed mdonnalley closed 1 week ago

mdonnalley commented 2 weeks ago

Correctly merge static properties up the Command class inheritance chain. Inspired by oclif/core's implementation

Fixes #764 @W-16844507@

justinwilaby commented 2 weeks ago

@mdonnalley - Can this be backported down to version 2.x so us dinosaurs can benefit from this fix?

mdonnalley commented 2 weeks ago

@justinwilaby you might be able to ship the heroku cli with plugin-commands v4 without issue. I tested heroku plugins:install @oclif/plugin-commands@^4 and it seems to be working as expected

justinwilaby commented 2 weeks ago

@justinwilaby you might be able to ship the heroku cli with plugin-commands v4 without issue. I tested heroku plugins:install @oclif/plugin-commands@^4 and it seems to be working as expected

If so, can this package use peerDependencies to specify a range of compatible @oclif/core versions?

mdonnalley commented 2 weeks ago

If so, can this package use peerDependencies to specify a range of compatible @oclif/core versions?

We can but the acceptable range is all of them - I'm not sure there'd but much value to it. In fact it would probably work even if heroku used the old oclif libraries instead of @oclif/core

justinwilaby commented 2 weeks ago

We can but the acceptable range is all of them - I'm not sure there'd but much value to it. In fact it would probably work even if heroku used the old oclif libraries instead of @oclif/core

Great! I suppose the value in the version range would be that implementors would not have yet another version of oclif core installed. The Heroku CLI currently has 3 versions of oclif core in it's dependency tree because of various plugins pinning the version to this one or that one. A version range would prevent this.

shetzel commented 1 week ago

QA: with your PR branch I now see args such as this for the addons rename command:

"args": {
      "addon_name": {
        "name": "addon_name",
        "required": true
      },
      "new_name": {
        "name": "new_name",
        "required": true
      }
    }