DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.67k stars 2.25k forks source link

Feature request #223

Closed ryanhellyer closed 9 years ago

ryanhellyer commented 10 years ago

It would be really handy if you could throw in a plugin slug, plugin name, plugin author etc. etc. and have it automatically spit out a plugin with everything named correctly at http://wppb.io/.

nderambure commented 10 years ago

Do you mean the same process than on the Underscore Theme from Automattic ? http://underscores.me

If yes, I +1 this !

ryanhellyer commented 10 years ago

Yeah, exactly that type of process!

ryanhellyer commented 10 years ago

I've considered doing this sort of thing myself in the past, but wasn't sure if anyone would find it useful so never proceeded with it. If it isn't deemed appropriate for this core service, then I may look at just implementing it on my own site and pull the data in from this repo. to generate it.

nderambure commented 10 years ago

I'm sure it could be a really usefull process, avoiding renaming parts of the plugin foundation.

haleeben commented 10 years ago

Somebody has already made one http://codegen.kickapz.com/, maybe the code could be merged

ryanhellyer commented 10 years ago

Ah, that's perfect! Even a link from somewhere obvious would suffice I think. Although having it all hosted at a single location would make a lot of sense.

nderambure commented 10 years ago

Great ! Thx for the link

2014-10-07 15:32 GMT+02:00 ryanhellyer notifications@github.com:

Ah, that's perfect! Even a link from somewhere obvious would suffice I think. Although having it all hosted at a single location would make a lot of sense.

— Reply to this email directly or view it on GitHub https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/issues/223#issuecomment-58184126 .

Nicolas Derambure Développeur / Intégrateur Web 06.89.56.30.03 nicolasderambure@gmail.com http://labomedia.org

grappler commented 10 years ago

see https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/issues/209

tommcfarlin commented 10 years ago

This is something that we have planned and a number of people have contacted me about doing it, so I'll plan to see if I can make this happen.

It'll fall inline after the Documentation effort.

sixtyseven-multimedia commented 10 years ago

I allready wrote such a generator and Tom has the files allready on his desk. So I think after the documentation, that will be one of the next steps.

chiwaili commented 9 years ago

Nice one sixtyseven-multimedia. Looking forward to it

tommcfarlin commented 9 years ago

@sixtyseven-multimedia is right. I have a few generators that I'm eventually looking to increate in the documentation effort that's starting in early January.

Right now, I've a few other projects that are keeping me busy but these are coming. I've not forgotten :).

chiwaili commented 9 years ago

@tommcfarlin Much appreciated. Imo take as long as you need, you've already been extremely generous (That's what I love about the Github community)

tommcfarlin commented 9 years ago

Thanks @chiwaili! Like most people, I'd love to move on faster with this kind of stuff, but it's a labor of love, obviously.

Gotta balance it with the projects that also pay the bills ;).

aaronware commented 9 years ago

Have you put in any thought about making it a grunt-init project scaffold? It's relatively easy to set it up to do so. It can use grunt and node locally to pattern match and replace strings. http://gruntjs.com/project-scaffolding We use it on https://github.com/linchpinagency/hatch for our base theme we use at our shop.

tommcfarlin commented 9 years ago

@aaronware yes - but it's not something that will be part of this core boilerplate. that will be a tangential project like this one.

cluke009 commented 9 years ago

Wish I found this earlier... Either way this might help someone integrate this great project into their workflow. Should work on OSX and Linux

find . -type f -print0 | xargs -0 sed -i '' 's/plugin-name/my-plugin/g'
find . -type f -print0 | xargs -0 sed -i '' 's/plugin_name/my_plugin/g'
find . -type f -print0 | xargs -0 sed -i '' 's/Plugin_Name/My_Plugin/g'
find . -type f -print0 | xargs -0 -n1 bash -c 'mv "$0" "${0/plugin-name/my-plugin}"'
tommcfarlin commented 9 years ago

@cluke009 Nice share - I think it's great to have a variety of ways to update the stubs in the boilerplate :).

tnorthcutt commented 9 years ago

http://wppb.me/ by @tmeister might be of interest to you @ryanhellyer

tommcfarlin commented 9 years ago

+1 to @tnorthcutt's suggestion.

jefferose commented 9 years ago

Beware using http://wppb.me - It renames all instances of plugin_name so the private variable $plugin_name becomes $xyz_plugin. It's consistent, so it all works, but it's a little funky.

mAAdhaTTah commented 9 years ago

The $plugin_name variable used to be named $plugin_slug. Maybe that makes more sense?

nderambure commented 9 years ago

Yep, I suggest changing the $plugin_name variable to $plugin_slug too.

codecowboy commented 9 years ago

@cluke009 Can you elaborate a bit on what those sed commands are doing exactly? I'm not familiar with sed, awk etc.

Is it transforming s/this-string/into-this-string/g ?

cluke009 commented 9 years ago

@codecowboy its simple replacement as you stated. I would also like to say that my method wasn't a completely pointless exercise as last time I checked both of those generator sites were using outdated version.

The commands just search in the files from the plugin root and change any instance of those strings they find. Not exactly the one-liner I was hoping for when I started but it gets the job done quickly enough

DevinVinson commented 9 years ago

Closing this out as wppb.me should handle auto generation completely. I'm hoping to get the same script included into the main site but it isn't a priority as Enrique has been keeping the .me generator updated.