Hello,
We develop a lot of themes based on Sage, and we would like to provide a way to automate the steps we take every time we start a new project.
Overview
When Sage 8 was released, @ben mentioned the idea of implementing a Yeoman generator for Sage. Sage 9 is now in alpha version on the master branch, but there is no official Yeoman generator yet. We have made a very simple Yeoman generator-sage as a proof of concept (forked from kdo/generator-wp-underscores). It currently works with Sage 8 and it is available at npmjs.com as well as github.com
We would like to have a collaborative talk to check if our approach is right, and find out more precisely what a Sage generator should do.
We have two open issues :
- What are the steps that we want to automate ?
- What is the best way of doing it ?
Steps
For the steps we should take when starting a Sage based theme, we have thought of the following :
- Update the style.css theme headers
- Change the theme namespace
- Change the theme text domain
- Remove the .github folder
- Remove the CHANGELOG.md, but keep LICENSE.md
- Replace sage occurrences and urls in bower.json, composer.json and package.json
- Update lang/sage.pot
- Choose which Soil modules should be active, and ask for modules options when needed
- Create an acf-json directory with a .gitkeep file inside (optional)
- Choose a frontend framework (bootstrap should not be the only choice) and update the dependencies files (Does this becomes simpler with Sage 9 ?)
Open issues
For now, the Yeoman generator approach seems to be working, but we are not sure if this is the best way. We would like to discuss it with you before further development (specially before we adapt the generator to Sage 9).
Do you agree with the above steps ?
Do you have any other project for automating those steps ?
Do you have any recommendations if we go further with Yeoman ?
The final purpose of an automated Sage starting process would be to provide multiple ways of getting your theme ready :
- Via the command line with the generator installed on your server
- With a web interface via a web browser, like the solution provided by http://underscores.me/
- Using http / curl requests: we should be able to build archives of initialized themes by querying a public endpoint, and allowing shell or wp-cli scripts to construct Sage based themes in a simple way.
Bests regards,
Pierre