windhamdavid 9 years ago
parent
commit
5a50b7e67b
3 changed files with 66 additions and 10 deletions
  1. 4 1
      .gitignore
  2. 61 8
      Gruntfile.js
  3. 1 1
      wp

+ 4 - 1
.gitignore

@@ -32,6 +32,7 @@ tests/*
 tools/*
 phpunit.xml
 tests/phpunit/data/plugins/wordpress-importer
+tests/phpunit/data/.trac-ticket-cache*
 vendor/*
 composer.phar
 
@@ -51,6 +52,7 @@ app/advanced-cache.php
 app/wp-cache-config.php
 app/cache/
 app/media/
+app/uploads/
 
 wp/wp-content/uploads/
 wp/wp-content/blogs.dir/
@@ -59,4 +61,5 @@ wp/wp-content/backup-db/
 wp/wp-content/upgrade/
 wp/wp-content/advanced-cache.php
 wp/wp-content/wp-cache-config.php
-wp/wp-content/cache/
+wp/wp-content/cache/
+wp/wp-content/sunrise.php

+ 61 - 8
Gruntfile.js

@@ -10,7 +10,8 @@ module.exports = function(grunt) {
 	grunt.initConfig({
 		autoprefixer: {
 			options: {
-				browsers: ['Android >= 2.1', 'Chrome >= 21', 'Explorer >= 7', 'Firefox >= 17', 'Opera >= 12.1', 'Safari >= 6.0']
+				browsers: ['Android >= 2.1', 'Chrome >= 21', 'Explorer >= 7', 'Firefox >= 17', 'Opera >= 12.1', 'Safari >= 6.0'],
+				cascade: false
 			},
 			core: {
 				expand: true,
@@ -54,6 +55,9 @@ module.exports = function(grunt) {
 							// Ignore unminified versions of external libs we don't ship:
 							'!wp-includes/js/backbone.js',
 							'!wp-includes/js/underscore.js',
+							'!wp-includes/js/jquery/jquery.masonry.js',
+							'!wp-includes/js/jquery/ui/*.js',
+							'!wp-includes/js/tinymce/tinymce.js',
 							'!wp-includes/version.php' // Exclude version.php
 						],
 						dest: BUILD_DIR
@@ -64,10 +68,27 @@ module.exports = function(grunt) {
 					}
 				]
 			},
+			'wp-admin-rtl': {
+				options: {
+					processContent: function( src ) {
+						return src.replace( /\.css/g, '-rtl.css' );
+					}
+				},
+				src: SOURCE_DIR + 'wp-admin/css/wp-admin.css',
+				dest: BUILD_DIR + 'wp-admin/css/wp-admin-rtl.css'
+			},
 			version: {
 				options: {
 					processContent: function( src ) {
-						return src.replace( /^(\$wp_version.+?)-src';/m, '$1\';' );
+						return src.replace( /^\$wp_version = '(.+?)';/m, function( str, version ) {
+							version = version.replace( /-src$/, '' );
+
+							// If the version includes an SVN commit (-12345), it's not a released alpha/beta. Append a date.
+							version = version.replace( /-[\d]{5}$/, '-' + grunt.template.today( 'yyyymmdd' ) );
+
+							/* jshint quotmark: true */
+							return "$wp_version = '" + version + "';";
+						});
 					}
 				},
 				files: [
@@ -195,7 +216,7 @@ module.exports = function(grunt) {
 					'**/*.js',
 					'!twenty{eleven,twelve,thirteen}/**',
 					// Third party scripts
-					'!twentyfourteen/js/html5.js'
+					'!twenty{fourteen,fifteen}/js/html5.js'
 				]
 			},
 			core: {
@@ -213,15 +234,14 @@ module.exports = function(grunt) {
 					'wp-includes/js/tinymce/plugins/wp*/plugin.js',
 					// Third party scripts
 					'!wp-admin/js/farbtastic.js',
-					'!wp-admin/js/iris.min.js',
 					'!wp-includes/js/backbone*.js',
 					'!wp-includes/js/swfobject.js',
 					'!wp-includes/js/underscore*.js',
-					'!wp-includes/js/zxcvbn.min.js',
 					'!wp-includes/js/colorpicker.js',
 					'!wp-includes/js/hoverIntent.js',
 					'!wp-includes/js/json2.js',
-					'!wp-includes/js/tw-sack.js'
+					'!wp-includes/js/tw-sack.js',
+					'!**/*.min.js'
 				],
 				// Remove once other JSHint errors are resolved
 				options: {
@@ -247,6 +267,36 @@ module.exports = function(grunt) {
 						return true;
 					}
 
+					return false;
+				}
+			},
+			plugins: {
+				expand: true,
+				cwd: SOURCE_DIR + 'wp-content/plugins',
+				src: [
+					'**/*.js',
+					'!**/*.min.js'
+				],
+				// Limit JSHint's run to a single specified plugin directory:
+				//
+				//    grunt jshint:plugins --dir=foldername
+				//
+				filter: function( dirpath ) {
+					var index, dir = grunt.option( 'dir' );
+
+					// Don't filter when no target folder is specified
+					if ( ! dir ) {
+						return true;
+					}
+
+					dirpath = dirpath.replace( /\\/g, '/' );
+					index = dirpath.lastIndexOf( '/' + dir );
+
+					// Match only the folder name passed from cli
+					if ( -1 !== index ) {
+						return true;
+					}
+
 					return false;
 				}
 			}
@@ -331,8 +381,8 @@ module.exports = function(grunt) {
 			build: {
 				files: {
 					src: [
-						BUILD_DIR + '/**/*.js',
-						'!' + BUILD_DIR + '/wp-content/**/*.js'
+						BUILD_DIR + 'wp-{admin,includes}/**/*.js',
+						BUILD_DIR + 'wp-content/themes/twenty*/**/*.js'
 					]
 				}
 			}
@@ -362,6 +412,9 @@ module.exports = function(grunt) {
 					interval: 2000
 				}
 			},
+			config: {
+				files: 'Gruntfile.js'
+			},
 			colors: {
 				files: [SOURCE_DIR + 'wp-admin/css/colors/**'],
 				tasks: ['sass:colors']

+ 1 - 1
wp

@@ -1 +1 @@
-Subproject commit 9b9289e0a3b6a0359217bc33205b3c194d3fd3cf
+Subproject commit db7b12e25ca02337c43cb22070128099f6525d7f