craftcms / generator

Scaffold new Craft CMS plugins, modules, and system components from the CLI
MIT License
84 stars 8 forks source link

Handle bug when making a private plugin #18

Closed marcusgaius closed 1 year ago

marcusgaius commented 1 year ago

Description

While making a private plugin, I opted for a handle without an underscore. The generator ignored it, and added an underscore to the beginning of the handle anyway at the end. Whether this is an intended behavior or not, I couldn't say, however, it seems to be counterintuitive, and should specify how private plugins will always get a leading underscore at the end or something like that.

Related key in composer.json: image

Steps to reproduce

  1. In terminal, run command php craft make plugin --with-docblocks
  2. At the step Plugin Handle, type a handle without an underscore, ie test-plugin

Additional info

brandonkelly commented 1 year ago

Yeah private plugins are identified by the fact that their handle begins with an underscore. Just updated the validation error to clarify that, for the next release:

> Plugin handle: [_foo] foo
Private plugin handles must begin with an underscore.
marcusgaius commented 1 year ago

After I have reported the issue, I realized that the underscore might be the defining characteristic of a private plugin. An error response for the prompt is the perfect fit.

brandonkelly commented 1 year ago

Generator 1.5.0 is out with that change!