2013-10-27 22:53:11 +01:00
|
|
|
/* jshint node:true */
|
2013-08-07 07:25:25 +02:00
|
|
|
module.exports = function(grunt) {
|
2013-10-27 22:53:11 +01:00
|
|
|
var path = require('path'),
|
2016-04-13 00:33:18 +02:00
|
|
|
fs = require( 'fs' ),
|
2013-10-27 22:53:11 +01:00
|
|
|
SOURCE_DIR = 'src/',
|
2015-03-05 20:48:59 +01:00
|
|
|
BUILD_DIR = 'build/',
|
2015-10-21 18:47:21 +02:00
|
|
|
autoprefixer = require('autoprefixer'),
|
2015-03-05 20:48:59 +01:00
|
|
|
mediaConfig = {},
|
2015-04-14 17:30:16 +02:00
|
|
|
mediaBuilds = ['audiovideo', 'grid', 'models', 'views'];
|
2013-08-07 07:25:25 +02:00
|
|
|
|
2013-11-14 19:16:59 +01:00
|
|
|
// Load tasks.
|
2014-06-21 21:44:26 +02:00
|
|
|
require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks );
|
|
|
|
// Load legacy utils
|
|
|
|
grunt.util = require('grunt-legacy-util');
|
2013-09-04 22:50:29 +02:00
|
|
|
|
2015-03-05 20:48:59 +01:00
|
|
|
mediaBuilds.forEach( function ( build ) {
|
2015-04-14 17:30:16 +02:00
|
|
|
var path = SOURCE_DIR + 'wp-includes/js/media';
|
2015-03-05 20:48:59 +01:00
|
|
|
mediaConfig[ build ] = { files : {} };
|
2015-04-14 17:30:16 +02:00
|
|
|
mediaConfig[ build ].files[ path + '-' + build + '.js' ] = [ path + '/' + build + '.manifest.js' ];
|
2015-03-05 20:48:59 +01:00
|
|
|
} );
|
|
|
|
|
2013-08-07 07:25:25 +02:00
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
2015-07-08 21:53:22 +02:00
|
|
|
postcss: {
|
2014-02-13 09:29:16 +01:00
|
|
|
options: {
|
2015-07-08 21:53:22 +02:00
|
|
|
processors: [
|
|
|
|
autoprefixer({
|
2015-11-02 21:43:55 +01:00
|
|
|
browsers: [
|
|
|
|
'Android >= 2.1',
|
|
|
|
'Chrome >= 21',
|
|
|
|
'Edge >= 12',
|
|
|
|
'Explorer >= 7',
|
|
|
|
'Firefox >= 17',
|
|
|
|
'Opera >= 12.1',
|
|
|
|
'Safari >= 6.0'
|
|
|
|
],
|
2015-07-08 21:53:22 +02:00
|
|
|
cascade: false
|
|
|
|
})
|
|
|
|
]
|
2014-02-13 09:29:16 +01:00
|
|
|
},
|
|
|
|
core: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: SOURCE_DIR,
|
|
|
|
src: [
|
|
|
|
'wp-admin/css/*.css',
|
|
|
|
'wp-includes/css/*.css'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
colors: {
|
|
|
|
expand: true,
|
|
|
|
cwd: BUILD_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
src: [
|
|
|
|
'wp-admin/css/colors/*/colors.css'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
clean: {
|
|
|
|
all: [BUILD_DIR],
|
|
|
|
dynamic: {
|
|
|
|
dot: true,
|
|
|
|
expand: true,
|
|
|
|
cwd: BUILD_DIR,
|
|
|
|
src: []
|
|
|
|
},
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26876 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-29 00:52:04 +01:00
|
|
|
tinymce: ['<%= concat.tinymce.dest %>'],
|
2013-11-09 21:43:58 +01:00
|
|
|
qunit: ['tests/qunit/compiled.html']
|
2013-08-07 07:25:25 +02:00
|
|
|
},
|
|
|
|
copy: {
|
2013-10-06 12:33:01 +02:00
|
|
|
files: {
|
2013-08-29 22:45:17 +02:00
|
|
|
files: [
|
|
|
|
{
|
|
|
|
dot: true,
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
2013-10-06 12:33:01 +02:00
|
|
|
src: [
|
|
|
|
'**',
|
2015-04-14 17:30:16 +02:00
|
|
|
'!wp-includes/js/media/**',
|
2013-10-06 12:33:01 +02:00
|
|
|
'!**/.{svn,git}/**', // Ignore version control directories.
|
Update Backbone from 1.0 to 1.1.
Also update Underscore to 1.6. Includes the development versions of both, which are not included in the build.
Here is Backbone's changelog:
* Made the return values of Collection’s `set`, `add`, `remove`, and `reset` more useful. Instead of returning `this`, they now return the changed (added, removed or updated) model or list of
models. (This means they can no longer be chained.)
* Backbone Views no longer automatically attach options passed to the constructor as `this.options` and Backbone Models no longer attach `url` and `urlRoot` options, but you can do it yourself if you prefer. (But if you extend `wp.Backbone.View`, options will be attached for you.)
* All `"invalid"` events now pass consistent arguments. First the model in question, then the error object, then options.
* You are no longer permitted to change the id of your model during `parse`. Use `idAttribute` instead.
* On the other hand, `parse` is now an excellent place to extract and vivify incoming nested JSON into associated submodels.
See [27171] (next commit) for changes made to WordPress to be compatible with Backbone 1.1.
props gcorne, georgestephanis.
see #26799.
git-svn-id: https://develop.svn.wordpress.org/trunk@27170 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-13 08:33:29 +01:00
|
|
|
// Ignore unminified versions of external libs we don't ship:
|
|
|
|
'!wp-includes/js/backbone.js',
|
|
|
|
'!wp-includes/js/underscore.js',
|
2014-03-04 03:19:41 +01:00
|
|
|
'!wp-includes/js/jquery/jquery.masonry.js',
|
2014-10-07 17:27:56 +02:00
|
|
|
'!wp-includes/js/jquery/ui/*.js',
|
2014-04-12 00:16:01 +02:00
|
|
|
'!wp-includes/js/tinymce/tinymce.js',
|
2013-12-07 07:00:34 +01:00
|
|
|
'!wp-includes/version.php' // Exclude version.php
|
2013-10-06 12:33:01 +02:00
|
|
|
],
|
2013-08-29 22:45:17 +02:00
|
|
|
dest: BUILD_DIR
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'wp-config-sample.php',
|
|
|
|
dest: BUILD_DIR
|
|
|
|
}
|
|
|
|
]
|
2013-08-07 07:25:25 +02:00
|
|
|
},
|
2016-01-18 10:56:06 +01:00
|
|
|
'wp-admin-css-compat-rtl': {
|
2014-02-19 22:42:36 +01:00
|
|
|
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'
|
|
|
|
},
|
2016-01-18 10:56:06 +01:00
|
|
|
'wp-admin-css-compat-min': {
|
|
|
|
options: {
|
|
|
|
processContent: function( src ) {
|
|
|
|
return src.replace( /\.css/g, '.min.css' );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
src: SOURCE_DIR + 'wp-admin/css/wp-admin.css',
|
|
|
|
dest: BUILD_DIR + 'wp-admin/css/wp-admin.min.css'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: BUILD_DIR + 'wp-admin/css/wp-admin-rtl.css',
|
|
|
|
dest: BUILD_DIR + 'wp-admin/css/wp-admin-rtl.min.css'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2013-10-06 12:33:01 +02:00
|
|
|
version: {
|
|
|
|
options: {
|
2013-10-27 22:53:11 +01:00
|
|
|
processContent: function( src ) {
|
2014-05-29 06:32:41 +02:00
|
|
|
return src.replace( /^\$wp_version = '(.+?)';/m, function( str, version ) {
|
|
|
|
version = version.replace( /-src$/, '' );
|
|
|
|
|
2016-01-15 12:53:29 +01:00
|
|
|
// If the version includes an SVN commit (-12345), it's not a released alpha/beta. Append a timestamp.
|
2016-01-20 03:01:57 +01:00
|
|
|
version = version.replace( /-[\d]{5}$/, '-' + grunt.template.today( 'yyyymmdd.HHMMss' ) );
|
2014-05-29 06:32:41 +02:00
|
|
|
|
2014-05-29 21:33:00 +02:00
|
|
|
/* jshint quotmark: true */
|
2014-05-29 06:32:41 +02:00
|
|
|
return "$wp_version = '" + version + "';";
|
|
|
|
});
|
2013-10-06 12:33:01 +02:00
|
|
|
}
|
|
|
|
},
|
2014-02-19 22:42:36 +01:00
|
|
|
src: SOURCE_DIR + 'wp-includes/version.php',
|
|
|
|
dest: BUILD_DIR + 'wp-includes/version.php'
|
2013-10-06 12:33:01 +02:00
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
dynamic: {
|
|
|
|
dot: true,
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
src: []
|
2013-11-09 21:43:58 +01:00
|
|
|
},
|
2013-11-09 22:18:23 +01:00
|
|
|
qunit: {
|
2013-11-09 21:43:58 +01:00
|
|
|
src: 'tests/qunit/index.html',
|
|
|
|
dest: 'tests/qunit/compiled.html',
|
|
|
|
options: {
|
|
|
|
processContent: function( src ) {
|
2015-06-06 21:57:54 +02:00
|
|
|
return src.replace( /(\".+?\/)src(\/.+?)(?:.min)?(.js\")/g , function( match, $1, $2, $3 ) {
|
|
|
|
// Don't add `.min` to files that don't have it.
|
|
|
|
return $1 + 'build' + $2 + ( /jquery$/.test( $2 ) ? '' : '.min' ) + $3;
|
|
|
|
} );
|
2013-11-09 21:43:58 +01:00
|
|
|
}
|
|
|
|
}
|
2013-08-07 07:25:25 +02:00
|
|
|
}
|
|
|
|
},
|
2015-03-05 20:48:59 +01:00
|
|
|
browserify: mediaConfig,
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
sass: {
|
|
|
|
colors: {
|
2013-11-14 00:37:30 +01:00
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.css',
|
2013-12-03 22:13:14 +01:00
|
|
|
src: ['wp-admin/css/colors/*/colors.scss'],
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
options: {
|
2013-11-14 00:37:30 +01:00
|
|
|
outputStyle: 'expanded'
|
|
|
|
}
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
}
|
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
cssmin: {
|
2014-02-19 22:42:36 +01:00
|
|
|
options: {
|
2015-11-18 21:27:45 +01:00
|
|
|
compatibility: 'ie7'
|
2014-02-19 22:42:36 +01:00
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
core: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.css',
|
|
|
|
src: [
|
2016-01-18 10:56:06 +01:00
|
|
|
'wp-admin/css/*.css',
|
|
|
|
'!wp-admin/css/wp-admin*.css',
|
2016-02-29 21:42:10 +01:00
|
|
|
'wp-includes/css/*.css',
|
|
|
|
'wp-includes/js/mediaelement/wp-mediaelement.css'
|
2013-08-07 07:25:25 +02:00
|
|
|
]
|
2013-11-12 22:18:45 +01:00
|
|
|
},
|
|
|
|
rtl: {
|
|
|
|
expand: true,
|
|
|
|
cwd: BUILD_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.css',
|
|
|
|
src: [
|
2016-01-18 10:56:06 +01:00
|
|
|
'wp-admin/css/*-rtl.css',
|
|
|
|
'!wp-admin/css/wp-admin*.css',
|
2013-11-12 22:18:45 +01:00
|
|
|
'wp-includes/css/*-rtl.css'
|
|
|
|
]
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
},
|
|
|
|
colors: {
|
|
|
|
expand: true,
|
|
|
|
cwd: BUILD_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.css',
|
|
|
|
src: [
|
2013-12-06 22:23:21 +01:00
|
|
|
'wp-admin/css/colors/*/*.css'
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
]
|
2013-11-12 22:18:45 +01:00
|
|
|
}
|
|
|
|
},
|
2015-02-27 14:40:03 +01:00
|
|
|
rtlcss: {
|
|
|
|
options: {
|
|
|
|
// rtlcss options
|
2016-03-10 17:00:11 +01:00
|
|
|
opts: {
|
|
|
|
clean: false,
|
|
|
|
processUrls: { atrule: true, decl: false },
|
2015-02-27 14:40:03 +01:00
|
|
|
stringMap: [
|
|
|
|
{
|
|
|
|
name: 'import-rtl-stylesheet',
|
2016-03-10 17:00:11 +01:00
|
|
|
priority: 10,
|
|
|
|
exclusive: true,
|
2015-02-27 14:40:03 +01:00
|
|
|
search: [ '.css' ],
|
|
|
|
replace: [ '-rtl.css' ],
|
|
|
|
options: {
|
|
|
|
scope: 'url',
|
|
|
|
ignoreCase: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2013-12-06 19:34:05 +01:00
|
|
|
},
|
2016-03-10 17:00:11 +01:00
|
|
|
saveUnmodified: false,
|
|
|
|
plugins: [
|
2015-02-27 21:18:05 +01:00
|
|
|
{
|
|
|
|
name: 'swap-dashicons-left-right-arrows',
|
2016-03-10 17:00:11 +01:00
|
|
|
priority: 10,
|
|
|
|
directives: {
|
|
|
|
control: {},
|
|
|
|
value: []
|
|
|
|
},
|
|
|
|
processors: [
|
|
|
|
{
|
|
|
|
expr: /content/im,
|
|
|
|
action: function( prop, value ) {
|
|
|
|
if ( value === '"\\f141"' ) { // dashicons-arrow-left
|
|
|
|
value = '"\\f139"';
|
|
|
|
} else if ( value === '"\\f340"' ) { // dashicons-arrow-left-alt
|
|
|
|
value = '"\\f344"';
|
|
|
|
} else if ( value === '"\\f341"' ) { // dashicons-arrow-left-alt2
|
|
|
|
value = '"\\f345"';
|
|
|
|
} else if ( value === '"\\f139"' ) { // dashicons-arrow-right
|
|
|
|
value = '"\\f141"';
|
|
|
|
} else if ( value === '"\\f344"' ) { // dashicons-arrow-right-alt
|
|
|
|
value = '"\\f340"';
|
|
|
|
} else if ( value === '"\\f345"' ) { // dashicons-arrow-right-alt2
|
|
|
|
value = '"\\f341"';
|
|
|
|
}
|
|
|
|
return { prop: prop, value: value };
|
|
|
|
}
|
2015-02-27 21:18:05 +01:00
|
|
|
}
|
2016-03-10 17:00:11 +01:00
|
|
|
]
|
2015-02-27 21:18:05 +01:00
|
|
|
}
|
2016-03-10 17:00:11 +01:00
|
|
|
]
|
2015-02-27 14:40:03 +01:00
|
|
|
},
|
|
|
|
core: {
|
2013-11-12 22:18:45 +01:00
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '-rtl.css',
|
|
|
|
src: [
|
|
|
|
'wp-admin/css/*.css',
|
2015-02-27 21:18:05 +01:00
|
|
|
'wp-includes/css/*.css',
|
|
|
|
|
|
|
|
// Exceptions
|
Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.
In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.
For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.
Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia
Fixes #32522.
git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:35:18 +02:00
|
|
|
'!wp-includes/css/dashicons.css',
|
2015-10-31 05:37:41 +01:00
|
|
|
'!wp-includes/css/wp-embed-template.css',
|
|
|
|
'!wp-includes/css/wp-embed-template-ie.css'
|
2013-11-12 22:18:45 +01:00
|
|
|
]
|
|
|
|
},
|
2013-12-04 18:21:01 +01:00
|
|
|
colors: {
|
|
|
|
expand: true,
|
|
|
|
cwd: BUILD_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '-rtl.css',
|
|
|
|
src: [
|
2013-12-06 22:23:21 +01:00
|
|
|
'wp-admin/css/colors/*/colors.css'
|
2013-12-04 18:21:01 +01:00
|
|
|
]
|
|
|
|
},
|
2013-11-12 22:18:45 +01:00
|
|
|
dynamic: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '-rtl.css',
|
|
|
|
src: []
|
2013-08-07 07:25:25 +02:00
|
|
|
}
|
|
|
|
},
|
2013-10-27 22:53:11 +01:00
|
|
|
jshint: {
|
|
|
|
options: grunt.file.readJSON('.jshintrc'),
|
|
|
|
grunt: {
|
2013-11-07 22:14:49 +01:00
|
|
|
src: ['Gruntfile.js']
|
2013-10-27 22:53:11 +01:00
|
|
|
},
|
|
|
|
tests: {
|
2013-11-07 22:14:49 +01:00
|
|
|
src: [
|
|
|
|
'tests/qunit/**/*.js',
|
2014-03-29 11:05:22 +01:00
|
|
|
'!tests/qunit/vendor/*',
|
2014-02-10 02:11:25 +01:00
|
|
|
'!tests/qunit/editor/**'
|
2013-11-07 22:14:49 +01:00
|
|
|
],
|
2013-10-27 22:53:11 +01:00
|
|
|
options: grunt.file.readJSON('tests/qunit/.jshintrc')
|
|
|
|
},
|
2013-11-13 00:41:17 +01:00
|
|
|
themes: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR + 'wp-content/themes',
|
|
|
|
src: [
|
2014-03-07 00:41:18 +01:00
|
|
|
'twenty*/**/*.js',
|
2013-11-13 00:41:17 +01:00
|
|
|
'!twenty{eleven,twelve,thirteen}/**',
|
|
|
|
// Third party scripts
|
2016-10-20 07:43:09 +02:00
|
|
|
'!twenty{fourteen,fifteen,sixteen}/js/html5.js',
|
|
|
|
'!twentyseventeen/assets/js/html5.js',
|
|
|
|
'!twentyseventeen/assets/js/jquery.scrollTo.js'
|
2013-11-13 00:41:17 +01:00
|
|
|
]
|
|
|
|
},
|
2015-02-09 17:00:44 +01:00
|
|
|
media: {
|
|
|
|
options: {
|
|
|
|
browserify: true
|
|
|
|
},
|
|
|
|
src: [
|
2015-04-14 17:30:16 +02:00
|
|
|
SOURCE_DIR + 'wp-includes/js/media/**/*.js'
|
2015-02-09 17:00:44 +01:00
|
|
|
]
|
|
|
|
},
|
2013-11-07 22:14:49 +01:00
|
|
|
core: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
src: [
|
|
|
|
'wp-admin/js/*.js',
|
|
|
|
'wp-includes/js/*.js',
|
2015-04-14 17:30:16 +02:00
|
|
|
// Built scripts.
|
|
|
|
'!wp-includes/js/media-*',
|
2013-11-07 22:14:49 +01:00
|
|
|
// WordPress scripts inside directories
|
|
|
|
'wp-includes/js/jquery/jquery.table-hotkeys.js',
|
|
|
|
'wp-includes/js/mediaelement/wp-mediaelement.js',
|
2016-02-29 21:42:10 +01:00
|
|
|
'wp-includes/js/mediaelement/wp-playlist.js',
|
2013-11-07 22:14:49 +01:00
|
|
|
'wp-includes/js/plupload/handlers.js',
|
|
|
|
'wp-includes/js/plupload/wp-plupload.js',
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26876 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-29 00:52:04 +01:00
|
|
|
'wp-includes/js/tinymce/plugins/wordpress/plugin.js',
|
|
|
|
'wp-includes/js/tinymce/plugins/wp*/plugin.js',
|
2013-11-07 22:14:49 +01:00
|
|
|
// Third party scripts
|
|
|
|
'!wp-admin/js/farbtastic.js',
|
2014-02-13 09:58:17 +01:00
|
|
|
'!wp-includes/js/backbone*.js',
|
2013-11-07 22:14:49 +01:00
|
|
|
'!wp-includes/js/swfobject.js',
|
2014-02-13 09:58:17 +01:00
|
|
|
'!wp-includes/js/underscore*.js',
|
2013-11-07 22:14:49 +01:00
|
|
|
'!wp-includes/js/colorpicker.js',
|
|
|
|
'!wp-includes/js/hoverIntent.js',
|
|
|
|
'!wp-includes/js/json2.js',
|
2014-02-27 20:38:51 +01:00
|
|
|
'!wp-includes/js/tw-sack.js',
|
2015-03-12 13:51:06 +01:00
|
|
|
'!wp-includes/js/twemoji.js',
|
2014-02-27 20:38:51 +01:00
|
|
|
'!**/*.min.js'
|
2013-11-07 22:14:49 +01:00
|
|
|
],
|
|
|
|
// Remove once other JSHint errors are resolved
|
|
|
|
options: {
|
|
|
|
curly: false,
|
|
|
|
eqeqeq: false
|
2013-11-08 01:40:38 +01:00
|
|
|
},
|
2014-04-30 23:39:43 +02:00
|
|
|
// Limit JSHint's run to a single specified file:
|
|
|
|
//
|
|
|
|
// grunt jshint:core --file=filename.js
|
|
|
|
//
|
|
|
|
// Optionally, include the file path:
|
|
|
|
//
|
|
|
|
// grunt jshint:core --file=path/to/filename.js
|
|
|
|
//
|
2013-11-08 01:40:38 +01:00
|
|
|
filter: function( filepath ) {
|
2013-11-14 19:16:59 +01:00
|
|
|
var index, file = grunt.option( 'file' );
|
2013-11-08 01:40:38 +01:00
|
|
|
|
|
|
|
// Don't filter when no target file is specified
|
|
|
|
if ( ! file ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Normalize filepath for Windows
|
|
|
|
filepath = filepath.replace( /\\/g, '/' );
|
2013-11-14 19:16:59 +01:00
|
|
|
index = filepath.lastIndexOf( '/' + file );
|
2013-11-08 01:40:38 +01:00
|
|
|
|
|
|
|
// Match only the filename passed from cli
|
2013-11-14 19:16:59 +01:00
|
|
|
if ( filepath === file || ( -1 !== index && index === filepath.length - ( file.length + 1 ) ) ) {
|
2013-11-08 01:40:38 +01:00
|
|
|
return true;
|
2014-06-21 22:02:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR + 'wp-content/plugins',
|
|
|
|
src: [
|
|
|
|
'**/*.js',
|
|
|
|
'!**/*.min.js'
|
|
|
|
],
|
2014-06-24 02:07:00 +02:00
|
|
|
// Limit JSHint's run to a single specified plugin directory:
|
2014-06-21 22:02:47 +02:00
|
|
|
//
|
2014-06-24 02:07:00 +02:00
|
|
|
// grunt jshint:plugins --dir=foldername
|
2014-06-21 22:02:47 +02:00
|
|
|
//
|
2014-06-24 02:07:00 +02:00
|
|
|
filter: function( dirpath ) {
|
|
|
|
var index, dir = grunt.option( 'dir' );
|
2014-06-21 22:02:47 +02:00
|
|
|
|
|
|
|
// Don't filter when no target folder is specified
|
2014-06-24 02:07:00 +02:00
|
|
|
if ( ! dir ) {
|
2014-06-21 22:02:47 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-06-24 02:07:00 +02:00
|
|
|
dirpath = dirpath.replace( /\\/g, '/' );
|
|
|
|
index = dirpath.lastIndexOf( '/' + dir );
|
2014-06-21 22:02:47 +02:00
|
|
|
|
|
|
|
// Match only the folder name passed from cli
|
|
|
|
if ( -1 !== index ) {
|
|
|
|
return true;
|
2013-11-08 01:40:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2013-10-27 22:53:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2013-08-30 06:06:34 +02:00
|
|
|
qunit: {
|
2014-02-10 02:11:25 +01:00
|
|
|
files: [
|
|
|
|
'tests/qunit/**/*.html',
|
|
|
|
'!tests/qunit/editor/**'
|
|
|
|
]
|
2013-08-30 06:06:34 +02:00
|
|
|
},
|
2013-11-09 22:18:23 +01:00
|
|
|
phpunit: {
|
2013-11-09 22:25:02 +01:00
|
|
|
'default': {
|
2013-11-09 22:18:23 +01:00
|
|
|
cmd: 'phpunit',
|
|
|
|
args: ['-c', 'phpunit.xml.dist']
|
|
|
|
},
|
|
|
|
ajax: {
|
|
|
|
cmd: 'phpunit',
|
|
|
|
args: ['-c', 'phpunit.xml.dist', '--group', 'ajax']
|
|
|
|
},
|
|
|
|
multisite: {
|
|
|
|
cmd: 'phpunit',
|
|
|
|
args: ['-c', 'tests/phpunit/multisite.xml']
|
2014-11-10 15:48:28 +01:00
|
|
|
},
|
|
|
|
'external-http': {
|
|
|
|
cmd: 'phpunit',
|
|
|
|
args: ['-c', 'phpunit.xml.dist', '--group', 'external-http']
|
2013-11-09 22:18:23 +01:00
|
|
|
}
|
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
uglify: {
|
2015-07-16 11:44:43 +02:00
|
|
|
options: {
|
|
|
|
ASCIIOnly: true
|
|
|
|
},
|
2013-08-07 07:25:25 +02:00
|
|
|
core: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.js',
|
|
|
|
src: [
|
|
|
|
'wp-admin/js/*.js',
|
|
|
|
'wp-includes/js/*.js',
|
2016-02-29 21:42:10 +01:00
|
|
|
'wp-includes/js/mediaelement/wp-mediaelement.js',
|
|
|
|
'wp-includes/js/mediaelement/wp-playlist.js',
|
2013-08-07 07:25:25 +02:00
|
|
|
'wp-includes/js/plupload/handlers.js',
|
|
|
|
'wp-includes/js/plupload/wp-plupload.js',
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26876 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-29 00:52:04 +01:00
|
|
|
'wp-includes/js/tinymce/plugins/wordpress/plugin.js',
|
|
|
|
'wp-includes/js/tinymce/plugins/wp*/plugin.js',
|
|
|
|
|
2013-08-07 07:25:25 +02:00
|
|
|
// Exceptions
|
2015-04-07 06:37:24 +02:00
|
|
|
'!wp-admin/js/bookmarklet.*', // Minified and updated in /src with the precommit task. See uglify:bookmarklet.
|
2013-08-07 07:25:25 +02:00
|
|
|
'!wp-admin/js/custom-header.js', // Why? We should minify this.
|
|
|
|
'!wp-admin/js/farbtastic.js',
|
|
|
|
'!wp-admin/js/iris.min.js',
|
2015-04-07 06:37:24 +02:00
|
|
|
'!wp-includes/js/backbone.*',
|
|
|
|
'!wp-includes/js/masonry.min.js',
|
2013-08-07 07:25:25 +02:00
|
|
|
'!wp-includes/js/swfobject.js',
|
2015-04-07 06:37:24 +02:00
|
|
|
'!wp-includes/js/underscore.*',
|
2015-11-20 00:05:39 +01:00
|
|
|
'!wp-includes/js/zxcvbn.min.js',
|
|
|
|
'!wp-includes/js/wp-embed.js' // We have extra options for this, see uglify:embed
|
2013-08-07 07:25:25 +02:00
|
|
|
]
|
2014-10-07 17:27:56 +02:00
|
|
|
},
|
2015-11-20 00:05:39 +01:00
|
|
|
embed: {
|
|
|
|
options: {
|
|
|
|
compress: {
|
|
|
|
conditionals: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.js',
|
|
|
|
src: ['wp-includes/js/wp-embed.js']
|
|
|
|
},
|
2015-02-09 01:42:28 +01:00
|
|
|
media: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.js',
|
|
|
|
src: [
|
2015-09-09 04:02:14 +02:00
|
|
|
'wp-includes/js/media-audiovideo.js',
|
|
|
|
'wp-includes/js/media-grid.js',
|
|
|
|
'wp-includes/js/media-models.js',
|
|
|
|
'wp-includes/js/media-views.js'
|
2015-02-09 01:42:28 +01:00
|
|
|
]
|
|
|
|
},
|
2014-10-07 17:27:56 +02:00
|
|
|
jqueryui: {
|
|
|
|
options: {
|
2015-11-07 13:36:24 +01:00
|
|
|
// Preserve comments that start with a bang.
|
|
|
|
preserveComments: /^!/
|
2014-10-07 17:27:56 +02:00
|
|
|
},
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
dest: BUILD_DIR,
|
|
|
|
ext: '.min.js',
|
|
|
|
src: ['wp-includes/js/jquery/ui/*.js']
|
2015-02-25 21:15:46 +01:00
|
|
|
},
|
|
|
|
bookmarklet: {
|
|
|
|
options: {
|
|
|
|
compress: {
|
|
|
|
negate_iife: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
src: SOURCE_DIR + 'wp-admin/js/bookmarklet.js',
|
|
|
|
dest: SOURCE_DIR + 'wp-admin/js/bookmarklet.min.js'
|
2016-08-18 20:54:41 +02:00
|
|
|
},
|
|
|
|
masonry: {
|
|
|
|
options: {
|
|
|
|
// Preserve comments that start with a bang.
|
|
|
|
preserveComments: /^!/
|
|
|
|
},
|
|
|
|
src: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.js',
|
2016-08-18 22:04:16 +02:00
|
|
|
dest: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.min.js'
|
2013-08-07 07:25:25 +02:00
|
|
|
}
|
|
|
|
},
|
2016-08-18 20:54:41 +02:00
|
|
|
|
2013-08-31 00:16:43 +02:00
|
|
|
concat: {
|
|
|
|
tinymce: {
|
|
|
|
options: {
|
|
|
|
separator: '\n',
|
|
|
|
process: function( src, filepath ) {
|
|
|
|
return '// Source: ' + filepath.replace( BUILD_DIR, '' ) + '\n' + src;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
src: [
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26876 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-29 00:52:04 +01:00
|
|
|
BUILD_DIR + 'wp-includes/js/tinymce/tinymce.min.js',
|
|
|
|
BUILD_DIR + 'wp-includes/js/tinymce/themes/modern/theme.min.js',
|
|
|
|
BUILD_DIR + 'wp-includes/js/tinymce/plugins/*/plugin.min.js'
|
2013-08-31 00:16:43 +02:00
|
|
|
],
|
|
|
|
dest: BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce.js'
|
2015-03-25 00:32:23 +01:00
|
|
|
},
|
|
|
|
emoji: {
|
|
|
|
options: {
|
|
|
|
separator: '\n',
|
|
|
|
process: function( src, filepath ) {
|
|
|
|
return '// Source: ' + filepath.replace( BUILD_DIR, '' ) + '\n' + src;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
src: [
|
|
|
|
BUILD_DIR + 'wp-includes/js/twemoji.min.js',
|
|
|
|
BUILD_DIR + 'wp-includes/js/wp-emoji.min.js'
|
|
|
|
],
|
|
|
|
dest: BUILD_DIR + 'wp-includes/js/wp-emoji-release.min.js'
|
2013-08-31 00:16:43 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
compress: {
|
|
|
|
tinymce: {
|
|
|
|
options: {
|
|
|
|
mode: 'gzip',
|
|
|
|
level: 9
|
|
|
|
},
|
|
|
|
src: '<%= concat.tinymce.dest %>',
|
|
|
|
dest: BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce.js.gz'
|
|
|
|
}
|
|
|
|
},
|
2014-01-17 19:14:15 +01:00
|
|
|
jsvalidate:{
|
2014-02-13 09:00:47 +01:00
|
|
|
options: {
|
2014-01-17 19:14:15 +01:00
|
|
|
globals: {},
|
|
|
|
esprimaOptions:{},
|
|
|
|
verbose: false
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
files: {
|
2014-01-29 05:44:31 +01:00
|
|
|
src: [
|
2014-10-17 22:37:07 +02:00
|
|
|
BUILD_DIR + 'wp-{admin,includes}/**/*.js',
|
|
|
|
BUILD_DIR + 'wp-content/themes/twenty*/**/*.js'
|
2014-01-29 05:44:31 +01:00
|
|
|
]
|
2014-01-17 19:14:15 +01:00
|
|
|
}
|
2014-01-29 05:44:31 +01:00
|
|
|
}
|
2014-01-17 19:14:15 +01:00
|
|
|
},
|
2014-02-13 09:00:47 +01:00
|
|
|
imagemin: {
|
|
|
|
core: {
|
|
|
|
expand: true,
|
|
|
|
cwd: SOURCE_DIR,
|
|
|
|
src: [
|
|
|
|
'wp-{admin,includes}/images/**/*.{png,jpg,gif,jpeg}',
|
|
|
|
'wp-includes/js/tinymce/skins/wordpress/images/*.{png,jpg,gif,jpeg}'
|
|
|
|
],
|
|
|
|
dest: SOURCE_DIR
|
|
|
|
}
|
|
|
|
},
|
2015-03-25 00:32:23 +01:00
|
|
|
includes: {
|
|
|
|
emoji: {
|
|
|
|
src: BUILD_DIR + 'wp-includes/formatting.php',
|
|
|
|
dest: '.'
|
Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.
In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.
For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.
Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia
Fixes #32522.
git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:35:18 +02:00
|
|
|
},
|
2015-10-17 03:20:19 +02:00
|
|
|
embed: {
|
2015-11-20 16:36:21 +01:00
|
|
|
src: BUILD_DIR + 'wp-includes/embed.php',
|
Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.
In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.
For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.
Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia
Fixes #32522.
git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:35:18 +02:00
|
|
|
dest: '.'
|
2015-03-25 00:32:23 +01:00
|
|
|
}
|
|
|
|
},
|
2015-03-05 20:48:59 +01:00
|
|
|
_watch: {
|
2013-08-07 07:25:25 +02:00
|
|
|
all: {
|
|
|
|
files: [
|
|
|
|
SOURCE_DIR + '**',
|
2015-09-09 04:11:23 +02:00
|
|
|
'!' + SOURCE_DIR + 'wp-includes/js/media/**',
|
2013-08-07 07:25:25 +02:00
|
|
|
// Ignore version control directories.
|
|
|
|
'!' + SOURCE_DIR + '**/.{svn,git}/**'
|
|
|
|
],
|
|
|
|
tasks: ['clean:dynamic', 'copy:dynamic'],
|
|
|
|
options: {
|
|
|
|
dot: true,
|
|
|
|
spawn: false,
|
|
|
|
interval: 2000
|
|
|
|
}
|
2013-08-30 06:06:34 +02:00
|
|
|
},
|
2014-09-29 19:20:58 +02:00
|
|
|
config: {
|
|
|
|
files: 'Gruntfile.js'
|
|
|
|
},
|
2013-11-14 00:37:30 +01:00
|
|
|
colors: {
|
2013-12-03 22:13:14 +01:00
|
|
|
files: [SOURCE_DIR + 'wp-admin/css/colors/**'],
|
2013-11-14 00:37:30 +01:00
|
|
|
tasks: ['sass:colors']
|
|
|
|
},
|
2013-11-12 22:18:45 +01:00
|
|
|
rtl: {
|
|
|
|
files: [
|
|
|
|
SOURCE_DIR + 'wp-admin/css/*.css',
|
|
|
|
SOURCE_DIR + 'wp-includes/css/*.css'
|
|
|
|
],
|
2015-02-27 14:40:03 +01:00
|
|
|
tasks: ['rtlcss:dynamic'],
|
2013-11-12 22:18:45 +01:00
|
|
|
options: {
|
|
|
|
spawn: false,
|
|
|
|
interval: 2000
|
|
|
|
}
|
|
|
|
},
|
2013-08-30 06:06:34 +02:00
|
|
|
test: {
|
2014-02-10 02:11:25 +01:00
|
|
|
files: [
|
|
|
|
'tests/qunit/**',
|
|
|
|
'!tests/qunit/editor/**'
|
|
|
|
],
|
2013-08-30 06:06:34 +02:00
|
|
|
tasks: ['qunit']
|
2013-08-07 07:25:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-10-21 00:23:21 +02:00
|
|
|
// Allow builds to be minimal
|
|
|
|
if( grunt.option( 'minimal-copy' ) ) {
|
|
|
|
var copyFilesOptions = grunt.config.get( 'copy.files.files' );
|
|
|
|
copyFilesOptions[0].src.push( '!wp-content/plugins/**' );
|
|
|
|
copyFilesOptions[0].src.push( '!wp-content/themes/!(twenty*)/**' );
|
|
|
|
grunt.config.set( 'copy.files.files', copyFilesOptions );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-07 07:25:25 +02:00
|
|
|
// Register tasks.
|
2013-10-06 12:33:01 +02:00
|
|
|
|
2013-11-12 22:18:45 +01:00
|
|
|
// RTL task.
|
2015-02-27 14:40:03 +01:00
|
|
|
grunt.registerTask('rtl', ['rtlcss:core', 'rtlcss:colors']);
|
2013-11-12 22:18:45 +01:00
|
|
|
|
2013-11-14 00:37:30 +01:00
|
|
|
// Color schemes task.
|
2015-07-08 21:53:22 +02:00
|
|
|
grunt.registerTask('colors', ['sass:colors', 'postcss:colors']);
|
Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.
Color scheme selection on your own profile page gives you a preview and autosaves the selection.
Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.
Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.
props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.
git-svn-id: https://develop.svn.wordpress.org/trunk@26137 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-13 20:37:10 +01:00
|
|
|
|
2014-06-28 04:08:05 +02:00
|
|
|
// JSHint task.
|
2015-02-09 17:00:44 +01:00
|
|
|
grunt.registerTask( 'jshint:corejs', [
|
|
|
|
'jshint:grunt',
|
|
|
|
'jshint:tests',
|
|
|
|
'jshint:themes',
|
|
|
|
'jshint:core',
|
|
|
|
'jshint:media'
|
|
|
|
] );
|
2014-06-28 04:08:05 +02:00
|
|
|
|
2015-03-05 20:48:59 +01:00
|
|
|
grunt.renameTask( 'watch', '_watch' );
|
2014-02-13 18:56:29 +01:00
|
|
|
|
2015-03-05 20:48:59 +01:00
|
|
|
grunt.registerTask( 'watch', function() {
|
|
|
|
if ( ! this.args.length || this.args.indexOf( 'browserify' ) > -1 ) {
|
|
|
|
grunt.config( 'browserify.options', {
|
|
|
|
browserifyOptions: {
|
|
|
|
debug: true
|
|
|
|
},
|
|
|
|
watch: true
|
|
|
|
} );
|
2014-02-19 22:42:36 +01:00
|
|
|
|
2015-03-05 20:48:59 +01:00
|
|
|
grunt.task.run( 'browserify' );
|
|
|
|
}
|
|
|
|
|
|
|
|
grunt.task.run( '_' + this.nameArgs );
|
|
|
|
} );
|
|
|
|
|
2016-04-15 12:18:03 +02:00
|
|
|
grunt.registerTask( 'precommit:image', [
|
2016-03-09 21:54:10 +01:00
|
|
|
'imagemin:core'
|
|
|
|
] );
|
|
|
|
|
|
|
|
grunt.registerTask( 'precommit:js', [
|
2015-03-05 20:48:59 +01:00
|
|
|
'browserify',
|
|
|
|
'jshint:corejs',
|
2015-03-13 22:08:14 +01:00
|
|
|
'uglify:bookmarklet',
|
2016-08-18 20:54:41 +02:00
|
|
|
'uglify:masonry',
|
2015-03-13 22:08:14 +01:00
|
|
|
'qunit:compiled'
|
2015-03-05 20:48:59 +01:00
|
|
|
] );
|
|
|
|
|
2016-03-09 21:54:10 +01:00
|
|
|
grunt.registerTask( 'precommit:css', [
|
|
|
|
'postcss:core'
|
|
|
|
] );
|
|
|
|
|
|
|
|
grunt.registerTask( 'precommit:php', [
|
|
|
|
'phpunit'
|
|
|
|
] );
|
|
|
|
|
|
|
|
grunt.registerTask( 'precommit', 'Runs test and build tasks in preparation for a commit', function() {
|
|
|
|
var done = this.async();
|
2016-04-13 00:33:18 +02:00
|
|
|
var map = {
|
|
|
|
svn: 'svn status --ignore-externals',
|
|
|
|
git: 'git status --short'
|
|
|
|
};
|
|
|
|
|
|
|
|
find( [
|
|
|
|
__dirname + '/.svn',
|
|
|
|
__dirname + '/.git',
|
|
|
|
path.dirname( __dirname ) + '/.svn'
|
|
|
|
] );
|
|
|
|
|
|
|
|
function find( set ) {
|
|
|
|
var dir;
|
|
|
|
|
|
|
|
if ( set.length ) {
|
|
|
|
fs.stat( dir = set.shift(), function( error ) {
|
|
|
|
error ? find( set ) : run( path.basename( dir ).substr( 1 ) );
|
|
|
|
} );
|
|
|
|
} else {
|
|
|
|
grunt.fatal( 'This WordPress install is not under version control.' );
|
2016-03-09 21:54:10 +01:00
|
|
|
}
|
|
|
|
}
|
2016-04-13 00:33:18 +02:00
|
|
|
|
|
|
|
function run( type ) {
|
|
|
|
var command = map[ type ].split( ' ' );
|
|
|
|
|
|
|
|
grunt.util.spawn( {
|
|
|
|
cmd: command.shift(),
|
|
|
|
args: command
|
|
|
|
}, function( error, result, code ) {
|
2016-04-15 12:18:03 +02:00
|
|
|
var taskList = [];
|
|
|
|
|
2016-04-13 00:33:18 +02:00
|
|
|
if ( code !== 0 ) {
|
|
|
|
grunt.fatal( 'The `' + map[ type ] + '` command returned a non-zero exit code.', code );
|
|
|
|
}
|
|
|
|
|
2016-06-19 14:31:15 +02:00
|
|
|
// Callback for finding modified paths.
|
|
|
|
function testPath( path ) {
|
|
|
|
var regex = new RegExp( ' ' + path + '$', 'm' );
|
|
|
|
return regex.test( result.stdout );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Callback for finding modified files by extension.
|
|
|
|
function testExtension( extension ) {
|
|
|
|
var regex = new RegExp( '\.' + extension + '$', 'm' );
|
|
|
|
return regex.test( result.stdout );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( [ 'package.json', 'Gruntfile.js' ].some( testPath ) ) {
|
2016-06-07 05:32:22 +02:00
|
|
|
grunt.log.writeln( 'Configuration files modified. Running `prerelease`.' );
|
|
|
|
taskList.push( 'prerelease' );
|
|
|
|
} else {
|
2016-06-19 14:31:15 +02:00
|
|
|
if ( [ 'png', 'jpg', 'gif', 'jpeg' ].some( testExtension ) ) {
|
2016-06-07 05:32:22 +02:00
|
|
|
grunt.log.writeln( 'Image files modified. Minifying.' );
|
2016-04-15 12:18:03 +02:00
|
|
|
taskList.push( 'precommit:image' );
|
|
|
|
}
|
|
|
|
|
2016-06-07 05:32:22 +02:00
|
|
|
[ 'js', 'css', 'php' ].forEach( function( extension ) {
|
2016-06-19 14:31:15 +02:00
|
|
|
if ( testExtension( extension ) ) {
|
2016-06-07 05:32:22 +02:00
|
|
|
grunt.log.writeln( extension.toUpperCase() + ' files modified. ' + extension.toUpperCase() + ' tests will be run.' );
|
|
|
|
taskList.push( 'precommit:' + extension );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
2016-04-13 00:33:18 +02:00
|
|
|
|
|
|
|
grunt.task.run( taskList );
|
|
|
|
|
|
|
|
done();
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
} );
|
2016-03-09 21:54:10 +01:00
|
|
|
|
2015-03-05 20:48:59 +01:00
|
|
|
grunt.registerTask( 'copy:all', [
|
|
|
|
'copy:files',
|
2016-01-18 10:56:06 +01:00
|
|
|
'copy:wp-admin-css-compat-rtl',
|
|
|
|
'copy:wp-admin-css-compat-min',
|
2015-03-05 20:48:59 +01:00
|
|
|
'copy:version'
|
|
|
|
] );
|
|
|
|
|
|
|
|
grunt.registerTask( 'build', [
|
|
|
|
'clean:all',
|
|
|
|
'copy:all',
|
|
|
|
'cssmin:core',
|
|
|
|
'colors',
|
|
|
|
'rtl',
|
|
|
|
'cssmin:rtl',
|
|
|
|
'cssmin:colors',
|
|
|
|
'uglify:core',
|
2015-11-20 00:05:39 +01:00
|
|
|
'uglify:embed',
|
2015-03-05 20:48:59 +01:00
|
|
|
'uglify:jqueryui',
|
|
|
|
'concat:tinymce',
|
|
|
|
'compress:tinymce',
|
|
|
|
'clean:tinymce',
|
2015-03-25 00:32:23 +01:00
|
|
|
'concat:emoji',
|
|
|
|
'includes:emoji',
|
2015-10-17 03:20:19 +02:00
|
|
|
'includes:embed',
|
2015-03-05 20:48:59 +01:00
|
|
|
'jsvalidate:build'
|
|
|
|
] );
|
2013-08-07 07:25:25 +02:00
|
|
|
|
2016-03-10 06:36:15 +01:00
|
|
|
grunt.registerTask( 'prerelease', [
|
|
|
|
'precommit:php',
|
|
|
|
'precommit:js',
|
|
|
|
'precommit:css',
|
2016-04-15 12:18:03 +02:00
|
|
|
'precommit:image'
|
2016-03-10 06:36:15 +01:00
|
|
|
] );
|
|
|
|
|
2013-11-09 21:43:58 +01:00
|
|
|
// Testing tasks.
|
2014-11-10 15:48:28 +01:00
|
|
|
grunt.registerMultiTask('phpunit', 'Runs PHPUnit tests, including the ajax, external-http, and multisite tests.', function() {
|
2013-11-09 22:25:02 +01:00
|
|
|
grunt.util.spawn({
|
|
|
|
cmd: this.data.cmd,
|
|
|
|
args: this.data.args,
|
|
|
|
opts: {stdio: 'inherit'}
|
|
|
|
}, this.async());
|
2013-11-09 22:18:23 +01:00
|
|
|
});
|
|
|
|
|
2013-11-09 22:25:02 +01:00
|
|
|
grunt.registerTask('qunit:compiled', 'Runs QUnit tests on compiled as well as uncompiled scripts.',
|
2013-11-13 00:20:28 +01:00
|
|
|
['build', 'copy:qunit', 'qunit']);
|
TinyMCE 4.0.12, first run.
- Removes wp-tinymce-schema.js and mark-loaded.js, no longer needed.
- Removes the inlinepopups and most of the wpdialogs plugins; wpdialog.js is moved to wp-includes/js.
- Adds charmap, compat3x, image, link and textcolor plugins, previously contained in /themes/advanced.
- Updates the wordpress, wpeditimage, wpfullscreen, wpgallery and wplink plugins.
- Updates DFW, wp-admin/js/wp-fullscreen.js.
See #24067.
git-svn-id: https://develop.svn.wordpress.org/trunk@26876 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-29 00:52:04 +01:00
|
|
|
|
2013-11-09 22:25:02 +01:00
|
|
|
grunt.registerTask('test', 'Runs all QUnit and PHPUnit tasks.', ['qunit:compiled', 'phpunit']);
|
2014-06-21 22:05:19 +02:00
|
|
|
|
|
|
|
// Travis CI tasks.
|
2014-06-28 04:08:05 +02:00
|
|
|
grunt.registerTask('travis:js', 'Runs Javascript Travis CI tasks.', [ 'jshint:corejs', 'qunit:compiled' ]);
|
2014-06-21 22:05:19 +02:00
|
|
|
grunt.registerTask('travis:phpunit', 'Runs PHPUnit Travis CI tasks.', 'phpunit');
|
2013-08-30 06:06:34 +02:00
|
|
|
|
2014-02-26 22:45:55 +01:00
|
|
|
// Patch task.
|
|
|
|
grunt.renameTask('patch_wordpress', 'patch');
|
|
|
|
|
2013-08-07 07:25:25 +02:00
|
|
|
// Default task.
|
|
|
|
grunt.registerTask('default', ['build']);
|
|
|
|
|
2015-09-09 04:11:23 +02:00
|
|
|
/*
|
|
|
|
* Automatically updates the `:dynamic` configurations
|
|
|
|
* so that only the changed files are updated.
|
|
|
|
*/
|
2013-08-31 00:16:43 +02:00
|
|
|
grunt.event.on('watch', function( action, filepath, target ) {
|
2015-09-09 04:11:23 +02:00
|
|
|
var src;
|
|
|
|
|
|
|
|
if ( [ 'all', 'rtl', 'browserify' ].indexOf( target ) === -1 ) {
|
2013-08-31 00:16:43 +02:00
|
|
|
return;
|
2013-10-27 22:53:11 +01:00
|
|
|
}
|
2013-08-31 00:16:43 +02:00
|
|
|
|
2015-09-09 04:11:23 +02:00
|
|
|
src = [ path.relative( SOURCE_DIR, filepath ) ];
|
2015-10-07 02:00:00 +02:00
|
|
|
|
2015-09-09 04:11:23 +02:00
|
|
|
if ( action === 'deleted' ) {
|
|
|
|
grunt.config( [ 'clean', 'dynamic', 'src' ], src );
|
|
|
|
} else {
|
|
|
|
grunt.config( [ 'copy', 'dynamic', 'src' ], src );
|
2013-08-07 07:25:25 +02:00
|
|
|
|
2015-09-09 04:11:23 +02:00
|
|
|
if ( target === 'rtl' ) {
|
|
|
|
grunt.config( [ 'rtlcss', 'dynamic', 'src' ], src );
|
|
|
|
}
|
|
|
|
}
|
2013-08-07 07:25:25 +02:00
|
|
|
});
|
|
|
|
};
|