generator-plugin-wp icon indicating copy to clipboard operation
generator-plugin-wp copied to clipboard

Yo commands could group generated content into 'components' using a folder structure.

Open aubreypwd opened this issue 9 years ago • 2 comments

Right now when you use a command such as yo plugin-wp:include <include-name> you end up with a class-<prefix>-<thing).php file in the includes/class...php folder. It would be nicer to create a folder when this happens:

includes/
    <component>/
        class-<prefix>-<thing>.php

This would allow us to create other sub-classes under a 'component' folder w/out having to do some funky changes to make that possible. This way I can easily create another includes folder in the 'component' folder, which can contain other classes, files, etc that I can include separately.

includes/
    <component>/
        class-<prefix>-<component>.php
            includes/
                 class-<prefix>-<component>-another-thing.php
                 template-tag.php
                 extras.php

Would also like to get some feedback before I attempt this.

aubreypwd avatar Feb 18 '17 17:02 aubreypwd

I think this harkens to a discussion we've had internally at WDS on dev calls.

At the moment one of the issues with the plugin-gen on larger projects is conflicts in the primary plugin file as we multiple devs scaffold different includes (see https://github.com/WebDevStudios/generator-plugin-wp/issues/135 ).

The issue at hand is does the use case you suggest indicate that perhaps multiple plugins would be better?

binarygary avatar Feb 19 '17 02:02 binarygary

@aubreypwd What are your thoughts on namespacing in addition to using something like

  • includes -- widgets -- CPT -- Taxonomies

This would add some structure and allow us to still separate into a looser component structure.

Your thoughts?

binarygary avatar Jul 20 '17 01:07 binarygary