Jump to content

Yeoman generator for ProcessWire


Recommended Posts

Hi all,

today I stumbled upon yeoman and went searching for a PW generator.

Larry Botha mentioned in a side not in his thread about MVC template approach that he has put a yeoman generator for PW together. I test installed it and it is working great.

Pretty fascinating how quick we can setup a PW project with yeoman. This definitely can be a great timesaver.

Larry's generator sets up a pretty opinionated PW install with his MVC structured fixate template and KSS etc.

It would be great if we could have an unopinionated version that gives us a clean PW install. We could add options to the generator for installing a choice of boilerplate templates like the blank template, Foundation, Bootstrap, Blog etc.

Just wanted to get your opinion on this. If any of you are interested, we could pull something together.




  • Like 12
Link to comment
Share on other sites

Funny, just yesterday I startet looking into yeoman, because I wanted to automate initializations of my projects in a more stable manner. Sure I have some shell scripts, aliases and functions set up to help me with that but, shell scripting is hell (at least for me, althoug I use zsh). Especially when it comes stuff other than copying and renaming files. Working with strings, numbers or templating ... yuk.

I have not yet looked at Larry's generator in detail, but sure we can lear from it. I have yet to create my first real generator but I'd love to participate.

I suggest that we collect ideas, what and how things should be done by the generator, and you @gebeer collect them in your original post.

Off the top of my head I think it would be cool if module installations/or at least module downloading could be integrated somehow. Either by asking for the module name, and the generator then searches through the modules repo, or via config file. Can we event put that info in the package.json? I do think so.

  • module installations
  • renaming of the example files like htaccess and so on
  • modifiying the htaccess via questions, that would require the htacces file to be in template form, so that directives can be included or excluded
  • downloading of pw, asking for dev or master
  • Like 3
Link to comment
Share on other sites

  • 11 months later...

We've made a lot of progress on our generator. We're now using Gulp to automate everything, but still, it ties in strongly with our PW Boilerplate. You'll likely find a lot of useful things in our generator that you can take over.

Some useful things:

  • automatically downloads the latest PW
  • automatically gets a few PW Modules we use in all projects
    • MarkupSimpleNavigation
    • ProcessRedirects
    • MarkupSitemapXML
  • install npm and all the dependencies in the Gulpfile
  • initialises bower

The generated Gulpfile has a bunch of useful utilities:

  • browsersync
  • sass and coffee compilation
  • asset revisioning for production cache busting (like fingerprinting in Rails apps)
  • rsync utilities

Instead of bash scripts being run, we've opted for a small Node app for better cross OS support.

Feel free to fork it, and add and remove as you see fit.

  • Like 8
Link to comment
Share on other sites

BernhardB, I am not sure what wireshell does yet, however looking at it quickly it seem to be an interface to processwire admin through the terminal. I would not sucgest that a node module will ever be replaced by a php shell plugin (even though its my first run in with this), however I would say that the two can rather be used alongside one another.

Generator =>

Create a basic project, generator can use wire shell to run certain commands.

Maybe even do the processwire db install and remove those annoying files (install.php and site/assets/install)

An example of a command for gulp would be make template,


- make the file required for the template using gulp-shell

- make the processwire template

This works nicely for the fixate-pw-generator since one can set the file the template use to their mvc as a default of the gulp task.

WireShell =>

used alongside gulp/ or vanilla WireShell to manage created project (fully aware of its install pw capability, but is it automated?)

Again this is only in theory for me thus far, but I doubt the one makes the other obsolete, both are big wins for the PW community.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...