Repository navigation
Conversation
TODO: - Update README - Use grunt-bower-task?
|
Looking good. I'd be very happy to use Bower for Bootstrap in 7.0, I've been using it plenty for other projects, and even for grabbing extra Javascript/jQuery plugins for Wordpress themes/plugins Not to go all crazy, but has anyone had experience with Gulp? http://gulpjs.com/ It's newer than GruntJS, but so far has been getting rave reviews, and looks easier to set up than Grunt, by a long shot. Even though I've gotten my head wrapped around the Gruntfile, it's still not very intuitive IMO. |
|
This branch is definitely a +1. I include the file assets for bootstrap in my version (tags) commits on my private repos, so I know what version of bootstrap I included in a release of a particular theme. The alternative was targeting a specific release in the bower file. Still not sure what way I like best. @retlehs Thanks for considering the bower solution |
|
@kalenjohnson #gulpjs is pretty, all gruntjs plugins are compatible with gulpjs, but not there is one as "grunt-wp-version" for cache styles and script files |
|
@retlehs I propose we copy (grunt-contrib-copy) the dist files the theme requires back into the appropriate asset folders for release. I feel this will make it easier for us to ignore the whole vendor directory when deploying and deploy only the needed asset folders. |
* default use filename version revving instead of querystring * versioning file will be ignore
Use grunt-wp-assets for version task
Dev: don't minify
Build: minify, lean Modernizr build
Dev assets will load if you have defined your WP_ENV as development
If you don't use Bedrock, you'll need to add this to your wp-config.php:
define('WP_ENV', 'development');
TODO: lib/scripts.php shouldn't need to be committed for changes after
running the version task
By writing to assets-manifest.json with grunt-filerev-assets, it's no longer necessary to commit changes to lib/scripts.php when developing
|
How about creating The reason for this, amongst other things, is that you won't have to worry about any git conflicts in files built with grunt, which can be pita sometimes... =D |
|
Files built with grunt are now gitignored, but would still like to add Sent from my iPhone On Feb 22, 2014, at 6:29 AM, "Miloš Gavrilović" notifications@github.com How about creating dist folder that will also be in .gitignore and where The reason for this, amongst other things, is that you won't have to worry — |
|
note: updated grunt workflow is not final. renaming the assets brings concerns about possible 404s related to caching. might go back to the querystring method and get rid of the new grunt-filerev and grunt-filerev-assets additions |
|
Just thinking about decoupling Roots from Bootstrap, with how mixins work for both LESS and SASS, we could potentially remove all Bootstrap classes from the markup and set up something like: I think the issue could be from the necessity of the .row class, that would still need to be wrapped somehow. |
|
I was thinking about this the other day too and ran into the same issue. I guess the question is is "do we open that can"? I don't think 7.0.0 is
On Fri, May 30, 2014 at 12:56 PM, Kalen Johnson notifications@github.com
|
|
yeah, i need to just get 7.0.0 out the door at this point. i'm going to finish up some docs for the site and then release it as is (maybe this weekend?) sorry it's taken so long, lots going on outside of roots right now 😓 |
|
Understood. You are the man!
On Fri, May 30, 2014 at 1:37 PM, Ben Word notifications@github.com wrote:
|
|
What do people think about adding imagemin (https://github.com/gruntjs/grunt-contrib-imagemin) to the gruntfile to compress any images included in the assets dir? I've found it helpful in projects using yeoman (spec. angular.) to slim down any images that can't be fetched dynamically. Not absollutely necessary, per se, but could help and easy to configure. @retlehs thanks again for your work on this! |
|
@markthethomas great idea! I would also suggest to add spritesmith (https://github.com/Ensighten/grunt-spritesmith) |
|
I think Imagemin and Spritesmith are too unstable/unreliable across various platforms and architectures, and they have nothing to do with Roots. I personally use them in my projects, but I would be against including them. They sometimes even fail during |
|
I 100% agree with @QWp6t! On Saturday, May 31, 2014, QWp6t notifications@github.com wrote:
|
|
Huh; I've never had any problems with it but that could just be my interaction with it so far. I'd suggest the relation to roots though would be compressing a filetype that's usually included (images of some kind) in a project. But since there are so many image compression tools (CLI and otherwise) and since people can easily include it on their own if they like, I'll agree with @QWp6t and @JulienMelissas and I don't think inclusion should happen here. And, I suppose, a good WP theme shouldn't have many non-dynamic images anyhow :) here's a gist for a gruntfile with imagemin and autoprefixer if anyone wants to include them on their own: https://gist.github.com/markthethomas/6b114f5fd7d55d29eca3 |
Retrieve manifest.json from local file system. Fixes #1048
If I add JavaScript packages to my `assets/js/plugins/` directory, they must be concatenated, uglified, and added to `scripts.js` to be used in my theme. The `watch:js` task should also note changes to those files and directories.
Make `grunt watch:js` include `assets/js/plugins/**/*.js`
Bump NPM package versions
dist/folder?roots.potWhat's new
Leaner Roots
Soil will now be a plugin that contains:
wp_head()clean up<html>attributes<link>tagsbody_class()<figure>and<figcaption>for WP captionsThe above features will be enabled in Roots (or any other theme) if Soil is activated by using
add_theme_support:add_theme_support('soil-clean-up');add_theme_support('soil-nice-search');add_theme_support('soil-root-relative-urls');Removed from Roots:
lib/cleanup.php- Moveroots_get_search_formtolib/utils.phplib/widgets.php- Remove vCard widget, move register sidebars tolib/init.phplib/relative-urls.phpBower for front-end package management
Bower is now being used to pull in Modernizr, jQuery, Bootstrap and Respond to
assets/vendor/. Whenever you're adding front-end assets to your project, you can usebower install <package>to add them to the vendor directory.We're also now using grunt-modernizr to make a lean build based on what tests you use in your styles and JS.
If you check out the
7.0.0branch, runnpm installfrom the theme dir andbower installwill run after the node dependencies have been installed.LESS organization
LESS files are organized differently, see #961 for details. tl;dr:
Grunt workflow
Previously, every time you updated your CSS or JS, a minified files and changes to
lib/scripts.phphad to be committed to the repo. The repo no longer includes any generated front-end assets. Grunt tasks are now split into two:devandbuild.The
devtask runs JSHint, compiles your LESS (non-minified) and concatenates your JSThe
buildtask runs JSHint, compiles and minifies your LESS, runs UglifyJS for concatenation and minification, generates a lean Modernizr build, and revisions CSS and JS based on the hashes.During
build,assets-manifest.jsonis generated with the names of the revisioned files.lib/scripts.phpreads that file and tells WordPress the correct path to the assets.Testing
Check out the
7.0.0branch and runnpm installfrom the theme directory. If you don't use Bedrock, you'll need to add the following to yourwp-config.php:Grunt tasks:
grunt devgrunt watch(same asdevexcept watches for file changes)grunt build— for staging/productionAlso grab https://github.com/roots/soil's
newbranch and enable the pluginNote: things are subject to change!
These changes are not yet final. Keep an eye on this PR for updates.