2013-10-27 21:53:11 +00:00
/* jshint node:true */
2018-12-24 13:53:11 +00:00
/* jshint esversion: 6 */
2017-10-03 07:11:28 +00:00
/* globals Set */
2018-12-11 16:38:21 +00:00
var webpackConfig = require ( './webpack.config' ) ;
2020-03-24 01:04:43 +00:00
var installChanged = require ( 'install-changed' ) ;
Editor: Improve block loading PHP performance.
This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.
Includes:
* Adding a new Grunt task to convert `block.json` files to `block-json.php`.
* Using the new `block-json.php` file in the `register_block_type_from_metadata()` function.
Follow-up to [48141].
Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes #55005.
git-svn-id: https://develop.svn.wordpress.org/trunk@54276 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-21 13:55:25 +00:00
var json2php = require ( 'json2php' ) ;
2017-10-04 21:00:15 +00:00
2013-08-07 05:25:25 +00:00
module . exports = function ( grunt ) {
2013-10-27 21:53:11 +00:00
var path = require ( 'path' ) ,
2016-04-12 22:33:18 +00:00
fs = require ( 'fs' ) ,
2021-02-26 14:07:53 +00:00
glob = require ( 'glob' ) ,
assert = require ( 'assert' ) . strict ,
2017-10-03 07:11:28 +00:00
spawn = require ( 'child_process' ) . spawnSync ,
2013-10-27 21:53:11 +00:00
SOURCE _DIR = 'src/' ,
2015-03-05 19:48:59 +00:00
BUILD _DIR = 'build/' ,
2018-12-24 13:28:22 +00:00
WORKING _DIR = grunt . option ( 'dev' ) ? SOURCE _DIR : BUILD _DIR ,
2022-04-29 13:59:49 +00:00
BANNER _TEXT = '/*! This file is auto-generated */' ,
2018-02-27 00:31:33 +00:00
autoprefixer = require ( 'autoprefixer' ) ,
2021-02-01 20:22:13 +00:00
sass = require ( 'sass' ) ,
2018-06-01 01:28:53 +00:00
phpUnitWatchGroup = grunt . option ( 'group' ) ,
buildFiles = [
'*.php' ,
'*.txt' ,
'*.html' ,
'wp-includes/**' , // Include everything in wp-includes.
'wp-admin/**' , // Include everything in wp-admin.
'wp-content/index.php' ,
2018-12-16 23:33:38 +00:00
'wp-content/themes/index.php' ,
'wp-content/themes/twenty*/**' ,
2018-06-01 01:28:53 +00:00
'wp-content/plugins/index.php' ,
'wp-content/plugins/hello.php' ,
2019-09-30 15:57:21 +00:00
'wp-content/plugins/akismet/**' ,
2020-02-18 09:25:25 +00:00
'!wp-content/themes/twenty*/node_modules/**' ,
2018-12-24 13:44:05 +00:00
] ,
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
// All built CSS files, in /src or /build.
cssFiles = [
'wp-admin/css/*.min.css' ,
'wp-admin/css/*-rtl*.css' ,
'wp-includes/css/*.min.css' ,
'wp-includes/css/*-rtl*.css' ,
'wp-admin/css/colors/**/*.css' ,
] ,
// All built js files, in /src or /build.
jsFiles = [
'wp-admin/js/' ,
'wp-includes/js/' ,
'wp-includes/blocks/**/*.js' ,
'wp-includes/blocks/**/*.js.map' ,
] ,
// All files built by Webpack, in /src or /build.
webpackFiles = [
'wp-includes/assets/*' ,
'wp-includes/css/dist' ,
2023-03-09 00:03:36 +00:00
'wp-includes/blocks/**/*.css' ,
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
'!wp-includes/assets/script-loader-packages.min.php' ,
2024-09-24 07:33:55 +00:00
'!wp-includes/assets/script-modules-packages.min.php' ,
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
] ,
// Prepend `dir` to `file`, and keep `!` in place.
setFilePath = function ( dir , file ) {
if ( '!' === file . charAt ( 0 ) ) {
return '!' + dir + file . substring ( 1 ) ;
}
return dir + file ;
} ,
2018-12-24 13:44:05 +00:00
changedFiles = {
php : [ ]
} ;
2018-02-27 00:31:33 +00:00
if ( 'watch:phpunit' === grunt . cli . tasks [ 0 ] && ! phpUnitWatchGroup ) {
grunt . log . writeln ( ) ;
grunt . fail . fatal (
'Missing required parameters. Example usage: ' + '\n\n' +
'grunt watch:phpunit --group=community-events' + '\n' +
'grunt watch:phpunit --group=multisite,mail'
) ;
}
2013-08-07 05:25:25 +00:00
2020-03-24 01:04:43 +00:00
// First do `npm install` if package.json has changed.
2023-10-13 08:13:58 +00:00
installChanged . watchPackage ( ) ;
2020-03-24 01:04:43 +00:00
2013-11-14 18:16:59 +00:00
// Load tasks.
2014-06-21 19:44:26 +00:00
require ( 'matchdep' ) . filterDev ( [ 'grunt-*' , '!grunt-legacy-util' ] ) . forEach ( grunt . loadNpmTasks ) ;
2023-01-27 15:53:15 +00:00
2020-01-29 00:43:23 +00:00
// Load legacy utils.
2014-06-21 19:44:26 +00:00
grunt . util = require ( 'grunt-legacy-util' ) ;
2013-09-04 20:50:29 +00:00
2023-01-27 15:53:15 +00:00
// Load PostCSS tasks.
grunt . loadNpmTasks ( '@lodder/grunt-postcss' ) ;
2013-08-07 05:25:25 +00:00
// Project configuration.
grunt . initConfig ( {
2015-07-08 19:53:22 +00:00
postcss : {
2014-02-13 08:29:16 +00:00
options : {
2015-07-08 19:53:22 +00:00
processors : [
autoprefixer ( {
cascade : false
} )
]
2014-02-13 08:29:16 +00:00
} ,
core : {
expand : true ,
cwd : SOURCE _DIR ,
dest : SOURCE _DIR ,
src : [
'wp-admin/css/*.css' ,
'wp-includes/css/*.css'
]
} ,
colors : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
2014-02-13 08:29:16 +00:00
src : [
'wp-admin/css/colors/*/colors.css'
]
}
} ,
2022-04-29 13:59:49 +00:00
usebanner : {
2017-08-19 20:09:31 +00:00
options : {
position : 'top' ,
banner : BANNER _TEXT ,
2017-08-20 09:12:36 +00:00
linebreak : true
2017-08-19 20:09:31 +00:00
} ,
files : {
src : [
2018-12-24 13:28:22 +00:00
WORKING _DIR + 'wp-admin/css/*.min.css' ,
2019-10-26 00:15:53 +00:00
WORKING _DIR + 'wp-admin/css/*-rtl*.css' ,
WORKING _DIR + 'wp-admin/js/**/*.min.js' ,
2018-12-24 13:28:22 +00:00
WORKING _DIR + 'wp-includes/css/*.min.css' ,
2019-10-26 00:15:53 +00:00
WORKING _DIR + 'wp-includes/css/*-rtl*.css' ,
WORKING _DIR + 'wp-includes/js/*.min.js' ,
WORKING _DIR + 'wp-includes/js/dist/*.min.js' ,
2018-12-24 13:28:22 +00:00
WORKING _DIR + 'wp-admin/css/colors/*/*.css'
2017-08-19 20:09:31 +00:00
]
}
} ,
2013-08-07 05:25:25 +00:00
clean : {
2018-06-01 01:28:53 +00:00
plugins : [ BUILD _DIR + 'wp-content/plugins' ] ,
themes : [ BUILD _DIR + 'wp-content/themes' ] ,
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
// Clean the files from /build and the JS, CSS, and Webpack files from /src.
2020-02-19 01:48:15 +00:00
files : buildFiles . concat ( [
'!wp-config.php' ,
] ) . map ( function ( file ) {
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
return setFilePath ( BUILD _DIR , file ) ;
} ) . concat (
cssFiles . map ( function ( file ) {
return setFilePath ( SOURCE _DIR , file ) ;
} )
) . concat (
jsFiles . map ( function ( file ) {
return setFilePath ( SOURCE _DIR , file ) ;
} )
) . concat (
webpackFiles . map ( function ( file ) {
return setFilePath ( SOURCE _DIR , file ) ;
} )
) ,
// Clean built JS, CSS, and Webpack files from either /src or /build.
css : cssFiles . map ( function ( file ) {
return setFilePath ( WORKING _DIR , file ) ;
} ) ,
js : jsFiles . map ( function ( file ) {
return setFilePath ( WORKING _DIR , file ) ;
} ) ,
'webpack-assets' : webpackFiles . map ( function ( file ) {
return setFilePath ( WORKING _DIR , file ) ;
2020-02-19 01:48:15 +00:00
} ) ,
2023-09-26 14:20:18 +00:00
'interactivity-assets' : [
WORKING _DIR + 'wp-includes/js/dist/interactivity.asset.php' ,
WORKING _DIR + 'wp-includes/js/dist/interactivity.min.asset.php' ,
] ,
2013-08-07 05:25:25 +00:00
dynamic : {
dot : true ,
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
2013-08-07 05:25:25 +00:00
src : [ ]
} ,
2013-11-09 20:43:58 +00:00
qunit : [ 'tests/qunit/compiled.html' ]
2013-08-07 05:25:25 +00:00
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
file _append : {
2020-10-07 16:31:53 +00:00
// grunt-file-append supports only strings for input and output.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
default _options : {
files : [
{
append : 'jQuery.noConflict();' ,
2018-12-24 13:28:22 +00:00
input : WORKING _DIR + 'wp-includes/js/jquery/jquery.js' ,
output : WORKING _DIR + 'wp-includes/js/jquery/jquery.js'
2020-10-07 16:31:53 +00:00
} ,
{
append : 'jQuery.noConflict();' ,
input : WORKING _DIR + 'wp-includes/js/jquery/jquery.min.js' ,
output : WORKING _DIR + 'wp-includes/js/jquery/jquery.min.js'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
]
}
} ,
2013-08-07 05:25:25 +00:00
copy : {
2013-10-06 10:33:01 +00:00
files : {
2013-08-29 20:45:17 +00:00
files : [
{
dot : true ,
expand : true ,
cwd : SOURCE _DIR ,
2018-06-01 01:28:53 +00:00
src : buildFiles . concat ( [
2020-03-02 19:08:48 +00:00
'!wp-includes/assets/**' , // Assets is extracted into separate copy tasks.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'!js/**' , // JavaScript is extracted into separate copy tasks.
2018-06-01 01:28:53 +00:00
'!.{svn,git}' , // Exclude version control folders.
2020-01-29 00:43:23 +00:00
'!wp-includes/version.php' , // Exclude version.php.
2018-12-18 03:13:58 +00:00
'!**/*.map' , // The build doesn't need .map files.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'!index.php' , '!wp-admin/index.php' ,
'!_index.php' , '!wp-admin/_index.php'
2018-06-01 01:28:53 +00:00
] ) ,
2013-08-29 20:45:17 +00:00
dest : BUILD _DIR
} ,
{
src : 'wp-config-sample.php' ,
dest : BUILD _DIR
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
{
2018-12-24 13:28:22 +00:00
[ BUILD _DIR + 'index.php' ] : [ 'src/_index.php' ] ,
[ BUILD _DIR + 'wp-admin/index.php' ] : [ 'src/wp-admin/_index.php' ]
2013-08-29 20:45:17 +00:00
}
]
2013-08-07 05:25:25 +00:00
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'npm-packages' : {
2019-01-10 01:38:22 +00:00
files : [
{
[ WORKING _DIR + 'wp-includes/js/backbone.js' ] : [ './node_modules/backbone/backbone.js' ] ,
2019-03-27 22:30:26 +00:00
[ WORKING _DIR + 'wp-includes/js/clipboard.js' ] : [ './node_modules/clipboard/dist/clipboard.js' ] ,
2019-01-10 01:38:22 +00:00
[ WORKING _DIR + 'wp-includes/js/hoverIntent.js' ] : [ './node_modules/jquery-hoverintent/jquery.hoverIntent.js' ] ,
2019-12-10 01:01:35 +00:00
2020-01-29 00:43:23 +00:00
// Renamed to avoid conflict with jQuery hoverIntent.min.js (after minifying).
2019-12-10 01:01:35 +00:00
[ WORKING _DIR + 'wp-includes/js/hoverintent-js.min.js' ] : [ './node_modules/hoverintent/dist/hoverintent.min.js' ] ,
2023-02-02 00:51:02 +00:00
2019-01-10 01:38:22 +00:00
[ WORKING _DIR + 'wp-includes/js/imagesloaded.min.js' ] : [ './node_modules/imagesloaded/imagesloaded.pkgd.min.js' ] ,
2021-02-26 17:49:58 +00:00
[ WORKING _DIR + 'wp-includes/js/jquery/jquery.js' ] : [ './node_modules/jquery/dist/jquery.js' ] ,
[ WORKING _DIR + 'wp-includes/js/jquery/jquery.min.js' ] : [ './node_modules/jquery/dist/jquery.min.js' ] ,
2019-01-10 01:38:22 +00:00
[ WORKING _DIR + 'wp-includes/js/jquery/jquery.form.js' ] : [ './node_modules/jquery-form/src/jquery.form.js' ] ,
2022-02-01 01:20:19 +00:00
[ WORKING _DIR + 'wp-includes/js/jquery/jquery.color.min.js' ] : [ './node_modules/jquery-color/dist/jquery.color.min.js' ] ,
2019-01-10 01:38:22 +00:00
[ WORKING _DIR + 'wp-includes/js/masonry.min.js' ] : [ './node_modules/masonry-layout/dist/masonry.pkgd.min.js' ] ,
[ WORKING _DIR + 'wp-includes/js/underscore.js' ] : [ './node_modules/underscore/underscore.js' ] ,
}
]
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
'vendor-js' : {
files : [
{
expand : true ,
cwd : SOURCE _DIR + 'js/_enqueues/vendor/' ,
src : [
'**/*' ,
'!farbtastic.js' ,
'!iris.min.js' ,
'!deprecated/**' ,
'!README.md' ,
// Ignore unminified version of vendor lib we don't ship.
'!jquery/jquery.masonry.js' ,
'!tinymce/tinymce.js'
] ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-includes/js/'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
{
expand : true ,
cwd : SOURCE _DIR + 'js/_enqueues/vendor/' ,
src : [
'farbtastic.js' ,
'iris.min.js'
] ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-admin/js/'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
{
expand : true ,
cwd : SOURCE _DIR + 'js/_enqueues/vendor/deprecated' ,
src : [
'suggest*'
] ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-includes/js/jquery/'
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
}
] . concat (
// Copy tinymce.js only when building to /src.
WORKING _DIR === SOURCE _DIR ? {
2019-01-10 01:38:22 +00:00
expand : true ,
cwd : SOURCE _DIR + 'js/_enqueues/vendor/tinymce/' ,
src : 'tinymce.js' ,
dest : SOURCE _DIR + 'wp-includes/js/tinymce/'
Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.
Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.
Fixes: #47749.
git-svn-id: https://develop.svn.wordpress.org/trunk@55484 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 01:01:45 +00:00
} : [ ]
)
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
'admin-js' : {
files : {
2018-12-24 13:28:22 +00:00
[ WORKING _DIR + 'wp-admin/js/accordion.js' ] : [ './src/js/_enqueues/lib/accordion.js' ] ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 22:12:02 +00:00
[ WORKING _DIR + 'wp-admin/js/application-passwords.js' ] : [ './src/js/_enqueues/admin/application-passwords.js' ] ,
[ WORKING _DIR + 'wp-admin/js/auth-app.js' ] : [ './src/js/_enqueues/admin/auth-app.js' ] ,
2018-12-24 13:28:22 +00:00
[ WORKING _DIR + 'wp-admin/js/code-editor.js' ] : [ './src/js/_enqueues/wp/code-editor.js' ] ,
[ WORKING _DIR + 'wp-admin/js/color-picker.js' ] : [ './src/js/_enqueues/lib/color-picker.js' ] ,
[ WORKING _DIR + 'wp-admin/js/comment.js' ] : [ './src/js/_enqueues/admin/comment.js' ] ,
[ WORKING _DIR + 'wp-admin/js/common.js' ] : [ './src/js/_enqueues/admin/common.js' ] ,
[ WORKING _DIR + 'wp-admin/js/custom-background.js' ] : [ './src/js/_enqueues/admin/custom-background.js' ] ,
[ WORKING _DIR + 'wp-admin/js/custom-header.js' ] : [ './src/js/_enqueues/admin/custom-header.js' ] ,
[ WORKING _DIR + 'wp-admin/js/customize-controls.js' ] : [ './src/js/_enqueues/wp/customize/controls.js' ] ,
[ WORKING _DIR + 'wp-admin/js/customize-nav-menus.js' ] : [ './src/js/_enqueues/wp/customize/nav-menus.js' ] ,
[ WORKING _DIR + 'wp-admin/js/customize-widgets.js' ] : [ './src/js/_enqueues/wp/customize/widgets.js' ] ,
[ WORKING _DIR + 'wp-admin/js/dashboard.js' ] : [ './src/js/_enqueues/wp/dashboard.js' ] ,
[ WORKING _DIR + 'wp-admin/js/edit-comments.js' ] : [ './src/js/_enqueues/admin/edit-comments.js' ] ,
[ WORKING _DIR + 'wp-admin/js/editor-expand.js' ] : [ './src/js/_enqueues/wp/editor/dfw.js' ] ,
[ WORKING _DIR + 'wp-admin/js/editor.js' ] : [ './src/js/_enqueues/wp/editor/base.js' ] ,
[ WORKING _DIR + 'wp-admin/js/gallery.js' ] : [ './src/js/_enqueues/lib/gallery.js' ] ,
[ WORKING _DIR + 'wp-admin/js/image-edit.js' ] : [ './src/js/_enqueues/lib/image-edit.js' ] ,
[ WORKING _DIR + 'wp-admin/js/inline-edit-post.js' ] : [ './src/js/_enqueues/admin/inline-edit-post.js' ] ,
[ WORKING _DIR + 'wp-admin/js/inline-edit-tax.js' ] : [ './src/js/_enqueues/admin/inline-edit-tax.js' ] ,
[ WORKING _DIR + 'wp-admin/js/language-chooser.js' ] : [ './src/js/_enqueues/lib/language-chooser.js' ] ,
[ WORKING _DIR + 'wp-admin/js/link.js' ] : [ './src/js/_enqueues/admin/link.js' ] ,
[ WORKING _DIR + 'wp-admin/js/media-gallery.js' ] : [ './src/js/_enqueues/deprecated/media-gallery.js' ] ,
[ WORKING _DIR + 'wp-admin/js/media-upload.js' ] : [ './src/js/_enqueues/admin/media-upload.js' ] ,
[ WORKING _DIR + 'wp-admin/js/media.js' ] : [ './src/js/_enqueues/admin/media.js' ] ,
[ WORKING _DIR + 'wp-admin/js/nav-menu.js' ] : [ './src/js/_enqueues/lib/nav-menu.js' ] ,
[ WORKING _DIR + 'wp-admin/js/password-strength-meter.js' ] : [ './src/js/_enqueues/wp/password-strength-meter.js' ] ,
Upgrade/Install: Show/hide toggle on password fields.
Add a show/hide toggle for new passwords in initial user creation and database access during install and setup process using the same model as on user profiles. Add a new password toggle script. Change setup config table to two columns, matching the install table layout.
Props xmarcos, matt, markjaquith, nazgul, akbigdog, intoxination, rob1n, MichaelH, empireoflight, rmccue, markoheijnen, r0uter, amansurov, bi0xid, DrewAPicture, Narthur, wpnook, markparnell, costdev, clorith, ryokuhi, sabernhardt, bgoewert, ironprogrammer, adeltahri, joedolson, mukesh27, audrasjb, sergeybiryukov.
Fixes #3534.
git-svn-id: https://develop.svn.wordpress.org/trunk@56008 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-23 23:07:10 +00:00
[ WORKING _DIR + 'wp-admin/js/password-toggle.js' ] : [ './src/js/_enqueues/admin/password-toggle.js' ] ,
2018-12-24 13:28:22 +00:00
[ WORKING _DIR + 'wp-admin/js/plugin-install.js' ] : [ './src/js/_enqueues/admin/plugin-install.js' ] ,
[ WORKING _DIR + 'wp-admin/js/post.js' ] : [ './src/js/_enqueues/admin/post.js' ] ,
[ WORKING _DIR + 'wp-admin/js/postbox.js' ] : [ './src/js/_enqueues/admin/postbox.js' ] ,
[ WORKING _DIR + 'wp-admin/js/revisions.js' ] : [ './src/js/_enqueues/wp/revisions.js' ] ,
[ WORKING _DIR + 'wp-admin/js/set-post-thumbnail.js' ] : [ './src/js/_enqueues/admin/set-post-thumbnail.js' ] ,
[ WORKING _DIR + 'wp-admin/js/svg-painter.js' ] : [ './src/js/_enqueues/wp/svg-painter.js' ] ,
[ WORKING _DIR + 'wp-admin/js/tags-box.js' ] : [ './src/js/_enqueues/admin/tags-box.js' ] ,
[ WORKING _DIR + 'wp-admin/js/tags-suggest.js' ] : [ './src/js/_enqueues/admin/tags-suggest.js' ] ,
[ WORKING _DIR + 'wp-admin/js/tags.js' ] : [ './src/js/_enqueues/admin/tags.js' ] ,
Admin: Introduce the Site Health screens.
The Site Health tool serves two purposes:
- Provide site owners with information to improve the performance, reliability, and security of their site.
- Collect comprehensive debug information about the site.
By encouraging site owners to maintain their site and adhere to modern best practices, we ultimately improve the software hygeine of both the WordPress ecosystem, and the open internet as a whole.
Props Clorith, hedgefield, melchoyce, xkon, karmatosed, jordesign, earnjam, ianbelanger, wpscholar, desrosj, pedromendonca, peterbooker, jcastaneda, garyj, soean, pento, timothyblynjacobs, zodiac1978, dgroddick, garrett-eclipse, netweb, tobifjellner, pixolin, afercia, joedolson, birgire.
See #46573.
git-svn-id: https://develop.svn.wordpress.org/trunk@44986 602fd350-edb4-49c9-b593-d223f7449a82
2019-03-23 03:54:16 +00:00
[ WORKING _DIR + 'wp-admin/js/site-health.js' ] : [ './src/js/_enqueues/admin/site-health.js' ] ,
General: Add an option to configure the site icon in general settings.
This restores the site icon setting to its original home on the settings page where it lives with the title and tagline.
The base for this code was originally added in [32994] and then removed in [33329]. The majority of the modification to that version are to remove the no-js pieces and make the workflow completely inline rather than putting the cropping on a separate page.
Additionally, since image crops rely on the ability to upload an image, this setting is gated by the `upload_files` capability.
Follow-up to: [32994], [33329].
Props jorbin, audrasjb, mukesh27, joedolson, afercia, kebbet, swissspidy, obenland, jameskoster, kjellr, andraganescu, stacimc, mikeschroder, h71, krupajnanda, huzaifaalmesbah.
Fixes #54370.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@57602 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-12 21:55:44 +00:00
[ WORKING _DIR + 'wp-admin/js/site-icon.js' ] : [ './src/js/_enqueues/admin/site-icon.js' ] ,
2019-05-26 20:49:04 +00:00
[ WORKING _DIR + 'wp-admin/js/privacy-tools.js' ] : [ './src/js/_enqueues/admin/privacy-tools.js' ] ,
2018-12-24 13:28:22 +00:00
[ WORKING _DIR + 'wp-admin/js/theme-plugin-editor.js' ] : [ './src/js/_enqueues/wp/theme-plugin-editor.js' ] ,
[ WORKING _DIR + 'wp-admin/js/theme.js' ] : [ './src/js/_enqueues/wp/theme.js' ] ,
[ WORKING _DIR + 'wp-admin/js/updates.js' ] : [ './src/js/_enqueues/wp/updates.js' ] ,
[ WORKING _DIR + 'wp-admin/js/user-profile.js' ] : [ './src/js/_enqueues/admin/user-profile.js' ] ,
[ WORKING _DIR + 'wp-admin/js/user-suggest.js' ] : [ './src/js/_enqueues/lib/user-suggest.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/custom-html-widgets.js' ] : [ './src/js/_enqueues/wp/widgets/custom-html.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/media-audio-widget.js' ] : [ './src/js/_enqueues/wp/widgets/media-audio.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/media-gallery-widget.js' ] : [ './src/js/_enqueues/wp/widgets/media-gallery.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/media-image-widget.js' ] : [ './src/js/_enqueues/wp/widgets/media-image.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/media-video-widget.js' ] : [ './src/js/_enqueues/wp/widgets/media-video.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/media-widgets.js' ] : [ './src/js/_enqueues/wp/widgets/media.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets/text-widgets.js' ] : [ './src/js/_enqueues/wp/widgets/text.js' ] ,
[ WORKING _DIR + 'wp-admin/js/widgets.js' ] : [ './src/js/_enqueues/admin/widgets.js' ] ,
[ WORKING _DIR + 'wp-admin/js/word-count.js' ] : [ './src/js/_enqueues/wp/utils/word-count.js' ] ,
[ WORKING _DIR + 'wp-admin/js/wp-fullscreen-stub.js' ] : [ './src/js/_enqueues/deprecated/fullscreen-stub.js' ] ,
[ WORKING _DIR + 'wp-admin/js/xfn.js' ] : [ './src/js/_enqueues/admin/xfn.js' ]
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
} ,
'includes-js' : {
files : {
2018-12-24 13:28:22 +00:00
[ WORKING _DIR + 'wp-includes/js/admin-bar.js' ] : [ './src/js/_enqueues/lib/admin-bar.js' ] ,
[ WORKING _DIR + 'wp-includes/js/api-request.js' ] : [ './src/js/_enqueues/wp/api-request.js' ] ,
[ WORKING _DIR + 'wp-includes/js/autosave.js' ] : [ './src/js/_enqueues/wp/autosave.js' ] ,
[ WORKING _DIR + 'wp-includes/js/comment-reply.js' ] : [ './src/js/_enqueues/lib/comment-reply.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-base.js' ] : [ './src/js/_enqueues/wp/customize/base.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-loader.js' ] : [ './src/js/_enqueues/wp/customize/loader.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-models.js' ] : [ './src/js/_enqueues/wp/customize/models.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-preview-nav-menus.js' ] : [ './src/js/_enqueues/wp/customize/preview-nav-menus.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-preview-widgets.js' ] : [ './src/js/_enqueues/wp/customize/preview-widgets.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-preview.js' ] : [ './src/js/_enqueues/wp/customize/preview.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-selective-refresh.js' ] : [ './src/js/_enqueues/wp/customize/selective-refresh.js' ] ,
[ WORKING _DIR + 'wp-includes/js/customize-views.js' ] : [ './src/js/_enqueues/wp/customize/views.js' ] ,
[ WORKING _DIR + 'wp-includes/js/heartbeat.js' ] : [ './src/js/_enqueues/wp/heartbeat.js' ] ,
[ WORKING _DIR + 'wp-includes/js/mce-view.js' ] : [ './src/js/_enqueues/wp/mce-view.js' ] ,
[ WORKING _DIR + 'wp-includes/js/media-editor.js' ] : [ './src/js/_enqueues/wp/media/editor.js' ] ,
[ WORKING _DIR + 'wp-includes/js/quicktags.js' ] : [ './src/js/_enqueues/lib/quicktags.js' ] ,
[ WORKING _DIR + 'wp-includes/js/shortcode.js' ] : [ './src/js/_enqueues/wp/shortcode.js' ] ,
[ WORKING _DIR + 'wp-includes/js/utils.js' ] : [ './src/js/_enqueues/lib/cookies.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-ajax-response.js' ] : [ './src/js/_enqueues/lib/ajax-response.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-api.js' ] : [ './src/js/_enqueues/wp/api.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-auth-check.js' ] : [ './src/js/_enqueues/lib/auth-check.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-backbone.js' ] : [ './src/js/_enqueues/wp/backbone.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-custom-header.js' ] : [ './src/js/_enqueues/wp/custom-header.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-embed-template.js' ] : [ './src/js/_enqueues/lib/embed-template.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-embed.js' ] : [ './src/js/_enqueues/wp/embed.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-emoji-loader.js' ] : [ './src/js/_enqueues/lib/emoji-loader.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-emoji.js' ] : [ './src/js/_enqueues/wp/emoji.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-list-revisions.js' ] : [ './src/js/_enqueues/lib/list-revisions.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-lists.js' ] : [ './src/js/_enqueues/lib/lists.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-pointer.js' ] : [ './src/js/_enqueues/lib/pointer.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-sanitize.js' ] : [ './src/js/_enqueues/wp/sanitize.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wp-util.js' ] : [ './src/js/_enqueues/wp/util.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wpdialog.js' ] : [ './src/js/_enqueues/lib/dialog.js' ] ,
[ WORKING _DIR + 'wp-includes/js/wplink.js' ] : [ './src/js/_enqueues/lib/link.js' ] ,
[ WORKING _DIR + 'wp-includes/js/zxcvbn-async.js' ] : [ './src/js/_enqueues/lib/zxcvbn-async.js' ]
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
} ,
2016-01-18 09:56:06 +00:00
'wp-admin-css-compat-rtl' : {
2014-02-19 21:42:36 +00:00
options : {
processContent : function ( src ) {
return src . replace ( /\.css/g , '-rtl.css' ) ;
}
} ,
src : SOURCE _DIR + 'wp-admin/css/wp-admin.css' ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-admin/css/wp-admin-rtl.css'
2014-02-19 21:42:36 +00:00
} ,
2016-01-18 09:56:06 +00: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' ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-admin/css/wp-admin.min.css'
2016-01-18 09:56:06 +00:00
} ,
{
2018-12-24 13:28:22 +00:00
src : WORKING _DIR + 'wp-admin/css/wp-admin-rtl.css' ,
dest : WORKING _DIR + 'wp-admin/css/wp-admin-rtl.min.css'
2016-01-18 09:56:06 +00:00
}
]
} ,
2013-10-06 10:33:01 +00:00
version : {
options : {
2013-10-27 21:53:11 +00:00
processContent : function ( src ) {
2014-05-29 04:32:41 +00:00
return src . replace ( /^\$wp_version = '(.+?)';/m , function ( str , version ) {
version = version . replace ( /-src$/ , '' ) ;
2016-01-15 11:53:29 +00:00
// If the version includes an SVN commit (-12345), it's not a released alpha/beta. Append a timestamp.
2016-01-20 02:01:57 +00:00
version = version . replace ( /-[\d]{5}$/ , '-' + grunt . template . today ( 'yyyymmdd.HHMMss' ) ) ;
2014-05-29 04:32:41 +00:00
2014-05-29 19:33:00 +00:00
/* jshint quotmark: true */
2014-05-29 04:32:41 +00:00
return "$wp_version = '" + version + "';" ;
} ) ;
2013-10-06 10:33:01 +00:00
}
} ,
2014-02-19 21:42:36 +00:00
src : SOURCE _DIR + 'wp-includes/version.php' ,
dest : BUILD _DIR + 'wp-includes/version.php'
2013-10-06 10:33:01 +00:00
} ,
2013-08-07 05:25:25 +00:00
dynamic : {
dot : true ,
expand : true ,
cwd : SOURCE _DIR ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR ,
2013-08-07 05:25:25 +00:00
src : [ ]
2013-11-09 20:43:58 +00:00
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'dynamic-js' : {
files : { }
} ,
2013-11-09 21:18:23 +00:00
qunit : {
2013-11-09 20:43:58 +00:00
src : 'tests/qunit/index.html' ,
dest : 'tests/qunit/compiled.html' ,
options : {
processContent : function ( src ) {
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
return src . replace ( /(\".+?\/)build(\/.+?)(?:.min)?(.js\")/g , function ( match , $1 , $2 , $3 ) {
2015-06-06 19:57:54 +00:00
// Don't add `.min` to files that don't have it.
return $1 + 'build' + $2 + ( /jquery$/ . test ( $2 ) ? '' : '.min' ) + $3 ;
} ) ;
2013-11-09 20:43:58 +00:00
}
}
2013-08-07 05:25:25 +00:00
}
} ,
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 19:37:10 +00:00
sass : {
colors : {
2013-11-13 23:37:30 +00:00
expand : true ,
cwd : SOURCE _DIR ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR ,
2013-11-13 23:37:30 +00:00
ext : '.css' ,
2013-12-03 21:13:14 +00: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 19:37:10 +00:00
options : {
2021-02-01 20:22:13 +00:00
implementation : sass
2013-11-13 23:37:30 +00:00
}
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 19:37:10 +00:00
}
} ,
2013-08-07 05:25:25 +00:00
cssmin : {
2014-02-19 21:42:36 +00:00
options : {
Administration: Remove any CSS related to Internet Explorer versions 6 â 10.
In WordPress 3.2 support for IE6 was dropped, IE7 followed a few versions later. With the 4.8 release, WordPress officially ended support for Internet Explorer versions 8, 9, and 10. Yet, we still have shipped CSS for the unsupported IE versions....until now! Goodbye to ie.css and star hacks!
* Removes ie.css and `ie` style handle.
* Removes IE specific class names and any related CSS.
* Drops support for IE8 and older in `wp_customize_support_script()`.
* Updates compatibility mode for CSS minification to `ie11`.
Props ayeshrajans, isabel_brison, afercia, netweb, peterwilsoncc, ocean90.
Fixes #17232, #46015.
git-svn-id: https://develop.svn.wordpress.org/trunk@47771 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-06 20:13:38 +00:00
compatibility : 'ie11'
2014-02-19 21:42:36 +00:00
} ,
2013-08-07 05:25:25 +00:00
core : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
2013-08-07 05:25:25 +00:00
ext : '.min.css' ,
src : [
2016-01-18 09:56:06 +00:00
'wp-admin/css/*.css' ,
'!wp-admin/css/wp-admin*.css' ,
2016-02-29 20:42:10 +00:00
'wp-includes/css/*.css' ,
'wp-includes/js/mediaelement/wp-mediaelement.css'
2013-08-07 05:25:25 +00:00
]
2013-11-12 21:18:45 +00:00
} ,
rtl : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
2013-11-12 21:18:45 +00:00
ext : '.min.css' ,
src : [
2016-01-18 09:56:06 +00:00
'wp-admin/css/*-rtl.css' ,
'!wp-admin/css/wp-admin*.css' ,
2013-11-12 21:18:45 +00: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 19:37:10 +00:00
} ,
colors : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
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 19:37:10 +00:00
ext : '.min.css' ,
src : [
2013-12-06 21:23:21 +00: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 19:37:10 +00:00
]
2013-11-12 21:18:45 +00:00
}
} ,
2015-02-27 13:40:03 +00:00
rtlcss : {
options : {
2020-01-29 00:43:23 +00:00
// rtlcss options.
2016-03-10 16:00:11 +00:00
opts : {
clean : false ,
processUrls : { atrule : true , decl : false } ,
2015-02-27 13:40:03 +00:00
stringMap : [
{
name : 'import-rtl-stylesheet' ,
2016-03-10 16:00:11 +00:00
priority : 10 ,
exclusive : true ,
2015-02-27 13:40:03 +00:00
search : [ '.css' ] ,
replace : [ '-rtl.css' ] ,
options : {
scope : 'url' ,
ignoreCase : false
}
}
]
2013-12-06 18:34:05 +00:00
} ,
2016-03-10 16:00:11 +00:00
saveUnmodified : false ,
plugins : [
2015-02-27 20:18:05 +00:00
{
name : 'swap-dashicons-left-right-arrows' ,
2016-03-10 16:00:11 +00: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 20:18:05 +00:00
}
2016-03-10 16:00:11 +00:00
]
2015-02-27 20:18:05 +00:00
}
2016-03-10 16:00:11 +00:00
]
2015-02-27 13:40:03 +00:00
} ,
core : {
2013-11-12 21:18:45 +00:00
expand : true ,
cwd : SOURCE _DIR ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR ,
2013-11-12 21:18:45 +00:00
ext : '-rtl.css' ,
src : [
'wp-admin/css/*.css' ,
2015-02-27 20:18:05 +00:00
'wp-includes/css/*.css' ,
2022-04-29 14:44:15 +00:00
/ *
* Exclude minified and already processed files , and files from external packages .
* These are present when running ` grunt build ` after ` grunt --dev ` .
* /
2019-05-16 02:24:58 +00:00
'!wp-admin/css/*-rtl.css' ,
'!wp-includes/css/*-rtl.css' ,
'!wp-admin/css/*.min.css' ,
'!wp-includes/css/*.min.css' ,
'!wp-includes/css/dist' ,
2020-01-29 00:43:23 +00:00
// 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 10:35:18 +00:00
'!wp-includes/css/dashicons.css' ,
2015-10-31 04:37:41 +00:00
'!wp-includes/css/wp-embed-template.css' ,
'!wp-includes/css/wp-embed-template-ie.css'
2013-11-12 21:18:45 +00:00
]
} ,
2013-12-04 17:21:01 +00:00
colors : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
2013-12-04 17:21:01 +00:00
ext : '-rtl.css' ,
src : [
2013-12-06 21:23:21 +00:00
'wp-admin/css/colors/*/colors.css'
2013-12-04 17:21:01 +00:00
]
} ,
2013-11-12 21:18:45 +00:00
dynamic : {
expand : true ,
cwd : SOURCE _DIR ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR ,
2013-11-12 21:18:45 +00:00
ext : '-rtl.css' ,
src : [ ]
2013-08-07 05:25:25 +00:00
}
} ,
2013-10-27 21:53:11 +00:00
jshint : {
2020-10-07 16:31:53 +00:00
options : grunt . file . readJSON ( '.jshintrc' ) ,
2013-10-27 21:53:11 +00:00
grunt : {
2013-11-07 21:14:49 +00:00
src : [ 'Gruntfile.js' ]
2013-10-27 21:53:11 +00:00
} ,
tests : {
2013-11-07 21:14:49 +00:00
src : [
'tests/qunit/**/*.js' ,
2014-03-29 10:05:22 +00:00
'!tests/qunit/vendor/*' ,
2014-02-10 01:11:25 +00:00
'!tests/qunit/editor/**'
2013-11-07 21:14:49 +00:00
] ,
2020-10-07 16:31:53 +00:00
options : grunt . file . readJSON ( 'tests/qunit/.jshintrc' )
2013-10-27 21:53:11 +00:00
} ,
2013-11-12 23:41:17 +00:00
themes : {
expand : true ,
cwd : SOURCE _DIR + 'wp-content/themes' ,
src : [
2014-03-06 23:41:18 +00:00
'twenty*/**/*.js' ,
2013-11-12 23:41:17 +00:00
'!twenty{eleven,twelve,thirteen}/**' ,
2020-01-29 00:43:23 +00:00
// Third party scripts.
2020-02-23 08:26:15 +00:00
'!twenty*/node_modules/**' ,
2016-10-20 05:43:09 +00:00
'!twenty{fourteen,fifteen,sixteen}/js/html5.js' ,
'!twentyseventeen/assets/js/html5.js' ,
2020-02-23 08:26:15 +00:00
'!twentyseventeen/assets/js/jquery.scrollTo.js'
2013-11-12 23:41:17 +00:00
]
} ,
2015-02-09 16:00:44 +00:00
media : {
src : [
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
SOURCE _DIR + 'js/media/**/*.js'
2015-02-09 16:00:44 +00:00
]
} ,
2013-11-07 21:14:49 +00:00
core : {
expand : true ,
cwd : SOURCE _DIR ,
src : [
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'js/_enqueues/**/*.js' ,
2020-01-29 00:43:23 +00:00
// Third party scripts.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'!js/_enqueues/vendor/**/*.js'
2013-11-07 21:14:49 +00:00
] ,
2020-01-29 00:43:23 +00:00
// Remove once other JSHint errors are resolved.
2013-11-07 21:14:49 +00:00
options : {
curly : false ,
eqeqeq : false
2013-11-08 00:40:38 +00:00
} ,
2020-01-29 00:43:23 +00: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 00:40:38 +00:00
filter : function ( filepath ) {
2013-11-14 18:16:59 +00:00
var index , file = grunt . option ( 'file' ) ;
2013-11-08 00:40:38 +00:00
2020-01-29 00:43:23 +00:00
// Don't filter when no target file is specified.
2013-11-08 00:40:38 +00:00
if ( ! file ) {
return true ;
}
2020-01-29 00:43:23 +00:00
// Normalize filepath for Windows.
2013-11-08 00:40:38 +00:00
filepath = filepath . replace ( /\\/g , '/' ) ;
2013-11-14 18:16:59 +00:00
index = filepath . lastIndexOf ( '/' + file ) ;
2013-11-08 00:40:38 +00:00
2020-01-29 00:43:23 +00:00
// Match only the filename passed from cli.
2013-11-14 18:16:59 +00:00
if ( filepath === file || ( - 1 !== index && index === filepath . length - ( file . length + 1 ) ) ) {
2013-11-08 00:40:38 +00:00
return true ;
2014-06-21 20:02:47 +00:00
}
return false ;
}
} ,
plugins : {
expand : true ,
cwd : SOURCE _DIR + 'wp-content/plugins' ,
src : [
'**/*.js' ,
'!**/*.min.js'
] ,
2020-01-29 00:43:23 +00:00
/ *
* Limit JSHint ' s run to a single specified plugin directory :
*
* grunt jshint : plugins -- dir = foldername
* /
2014-06-24 00:07:00 +00:00
filter : function ( dirpath ) {
var index , dir = grunt . option ( 'dir' ) ;
2014-06-21 20:02:47 +00:00
2020-01-29 00:43:23 +00:00
// Don't filter when no target folder is specified.
2014-06-24 00:07:00 +00:00
if ( ! dir ) {
2014-06-21 20:02:47 +00:00
return true ;
}
2014-06-24 00:07:00 +00:00
dirpath = dirpath . replace ( /\\/g , '/' ) ;
index = dirpath . lastIndexOf ( '/' + dir ) ;
2014-06-21 20:02:47 +00:00
2020-01-29 00:43:23 +00:00
// Match only the folder name passed from cli.
2014-06-21 20:02:47 +00:00
if ( - 1 !== index ) {
return true ;
2013-11-08 00:40:38 +00:00
}
return false ;
2013-10-27 21:53:11 +00:00
}
}
} ,
2017-09-08 18:41:20 +00:00
jsdoc : {
dist : {
dest : 'jsdoc' ,
options : {
configure : 'jsdoc.conf.json'
}
}
} ,
2013-08-30 04:06:34 +00:00
qunit : {
2014-02-10 01:11:25 +00:00
files : [
'tests/qunit/**/*.html' ,
'!tests/qunit/editor/**'
]
2013-08-30 04:06:34 +00:00
} ,
2013-11-09 21:18:23 +00:00
phpunit : {
2013-11-09 21:25:02 +00:00
'default' : {
2017-04-22 20:24:11 +00:00
args : [ '--verbose' , '-c' , 'phpunit.xml.dist' ]
2013-11-09 21:18:23 +00:00
} ,
ajax : {
2017-04-22 20:24:11 +00:00
args : [ '--verbose' , '-c' , 'phpunit.xml.dist' , '--group' , 'ajax' ]
2013-11-09 21:18:23 +00:00
} ,
multisite : {
2017-04-22 20:24:11 +00:00
args : [ '--verbose' , '-c' , 'tests/phpunit/multisite.xml' ]
2014-11-10 14:48:28 +00:00
} ,
2020-12-18 14:38:28 +00:00
'ms-ajax' : {
args : [ '--verbose' , '-c' , 'tests/phpunit/multisite.xml' , '--group' , 'ajax' ]
} ,
2017-10-01 22:15:16 +00:00
'ms-files' : {
args : [ '--verbose' , '-c' , 'tests/phpunit/multisite.xml' , '--group' , 'ms-files' ]
} ,
2014-11-10 14:48:28 +00:00
'external-http' : {
2017-04-22 20:24:11 +00:00
args : [ '--verbose' , '-c' , 'phpunit.xml.dist' , '--group' , 'external-http' ]
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 04:22:32 +00:00
} ,
'restapi-jsclient' : {
2017-04-22 20:24:11 +00:00
args : [ '--verbose' , '-c' , 'phpunit.xml.dist' , '--group' , 'restapi-jsclient' ]
2013-11-09 21:18:23 +00:00
}
} ,
2013-08-07 05:25:25 +00:00
uglify : {
2015-07-16 09:44:43 +00:00
options : {
2019-10-05 21:59:32 +00:00
output : {
ascii _only : true
}
2015-07-16 09:44:43 +00:00
} ,
2013-08-07 05:25:25 +00:00
core : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
2013-08-07 05:25:25 +00:00
ext : '.min.js' ,
src : [
2017-05-11 18:54:24 +00:00
'wp-admin/js/**/*.js' ,
2013-08-07 05:25:25 +00:00
'wp-includes/js/*.js' ,
2017-09-22 20:09:49 +00:00
'wp-includes/js/plupload/*.js' ,
2016-02-29 20:42:10 +00:00
'wp-includes/js/mediaelement/wp-mediaelement.js' ,
'wp-includes/js/mediaelement/wp-playlist.js' ,
2017-10-18 02:25:06 +00:00
'wp-includes/js/mediaelement/mediaelement-migrate.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-28 23:52:04 +00:00
'wp-includes/js/tinymce/plugins/wordpress/plugin.js' ,
'wp-includes/js/tinymce/plugins/wp*/plugin.js' ,
2020-01-29 00:43:23 +00:00
// Exceptions.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'!**/*.min.js' ,
2013-08-07 05:25:25 +00:00
'!wp-admin/js/custom-header.js' , // Why? We should minify this.
'!wp-admin/js/farbtastic.js' ,
'!wp-includes/js/swfobject.js' ,
]
2014-10-07 15:27:56 +00:00
} ,
2020-10-07 16:31:53 +00:00
'jquery-ui' : {
2014-10-07 15:27:56 +00:00
options : {
2015-11-07 12:36:24 +00:00
// Preserve comments that start with a bang.
2019-10-05 21:59:32 +00:00
output : {
comments : /^!/
}
2014-10-07 15:27:56 +00:00
} ,
expand : true ,
2020-10-07 16:31:53 +00:00
cwd : WORKING _DIR + 'wp-includes/js/jquery/ui/' ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-includes/js/jquery/ui/' ,
2014-10-07 15:27:56 +00:00
ext : '.min.js' ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
src : [ '*.js' ]
2018-04-03 19:45:39 +00:00
} ,
imgareaselect : {
2018-12-24 13:28:22 +00:00
src : WORKING _DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.js' ,
dest : WORKING _DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.min.js'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} ,
2019-02-14 00:06:39 +00:00
jqueryform : {
src : WORKING _DIR + 'wp-includes/js/jquery/jquery.form.js' ,
dest : WORKING _DIR + 'wp-includes/js/jquery/jquery.form.min.js'
} ,
2020-06-17 17:38:40 +00:00
moment : {
src : WORKING _DIR + 'wp-includes/js/dist/vendor/moment.js' ,
dest : WORKING _DIR + 'wp-includes/js/dist/vendor/moment.min.js'
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
dynamic : {
expand : true ,
2018-12-24 13:28:22 +00:00
cwd : WORKING _DIR ,
dest : WORKING _DIR ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
ext : '.min.js' ,
src : [ ]
2013-08-07 05:25:25 +00:00
}
} ,
2017-10-04 21:00:15 +00:00
webpack : {
2018-12-24 13:28:22 +00:00
prod : webpackConfig ( { environment : 'production' , buildTarget : WORKING _DIR } ) ,
dev : webpackConfig ( { environment : 'development' , buildTarget : WORKING _DIR } ) ,
2018-12-13 15:25:37 +00:00
watch : webpackConfig ( { environment : 'development' , watch : true } )
2017-10-04 21:00:15 +00:00
} ,
2013-08-30 22:16:43 +00:00
concat : {
tinymce : {
options : {
separator : '\n' ,
process : function ( src , filepath ) {
2018-12-24 13:28:22 +00:00
return '// Source: ' + filepath . replace ( WORKING _DIR , '' ) + '\n' + src ;
2013-08-30 22:16:43 +00:00
}
} ,
src : [
2018-12-24 13:28:22 +00:00
WORKING _DIR + 'wp-includes/js/tinymce/tinymce.min.js' ,
WORKING _DIR + 'wp-includes/js/tinymce/themes/modern/theme.min.js' ,
WORKING _DIR + 'wp-includes/js/tinymce/plugins/*/plugin.min.js'
2013-08-30 22:16:43 +00:00
] ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-includes/js/tinymce/wp-tinymce.js'
2015-03-24 23:32:23 +00:00
} ,
emoji : {
options : {
separator : '\n' ,
process : function ( src , filepath ) {
2018-12-24 13:28:22 +00:00
return '// Source: ' + filepath . replace ( WORKING _DIR , '' ) + '\n' + src ;
2015-03-24 23:32:23 +00:00
}
} ,
src : [
2018-12-24 13:28:22 +00:00
WORKING _DIR + 'wp-includes/js/twemoji.min.js' ,
WORKING _DIR + 'wp-includes/js/wp-emoji.min.js'
2015-03-24 23:32:23 +00:00
] ,
2018-12-24 13:28:22 +00:00
dest : WORKING _DIR + 'wp-includes/js/wp-emoji-release.min.js'
2013-08-30 22:16:43 +00:00
}
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
patch : {
options : {
file _mappings : {
'src/wp-admin/js/accordion.js' : 'src/js/_enqueues/lib/accordion.js' ,
REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.
This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.
Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.
Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.
git-svn-id: https://develop.svn.wordpress.org/trunk@49109 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-08 22:12:02 +00:00
'src/wp-admin/js/application-passwords.js' : 'src/js/_enqueues/admin/application-passwords.js' ,
'src/wp-admin/js/auth-app.js' : 'src/js/_enqueues/admin/auth-app.js' ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'src/wp-admin/js/code-editor.js' : 'src/js/_enqueues/wp/code-editor.js' ,
'src/wp-admin/js/color-picker.js' : 'src/js/_enqueues/lib/color-picker.js' ,
'src/wp-admin/js/comment.js' : 'src/js/_enqueues/admin/comment.js' ,
'src/wp-admin/js/common.js' : 'src/js/_enqueues/admin/common.js' ,
'src/wp-admin/js/custom-background.js' : 'src/js/_enqueues/admin/custom-background.js' ,
'src/wp-admin/js/custom-header.js' : 'src/js/_enqueues/admin/custom-header.js' ,
'src/wp-admin/js/customize-controls.js' : 'src/js/_enqueues/wp/customize/controls.js' ,
'src/wp-admin/js/customize-nav-menus.js' : 'src/js/_enqueues/wp/customize/nav-menus.js' ,
'src/wp-admin/js/customize-widgets.js' : 'src/js/_enqueues/wp/customize/widgets.js' ,
'src/wp-admin/js/dashboard.js' : 'src/js/_enqueues/wp/dashboard.js' ,
'src/wp-admin/js/edit-comments.js' : 'src/js/_enqueues/admin/edit-comments.js' ,
'src/wp-admin/js/editor-expand.js' : 'src/js/_enqueues/wp/editor/dfw.js' ,
'src/wp-admin/js/editor.js' : 'src/js/_enqueues/wp/editor/base.js' ,
'src/wp-admin/js/gallery.js' : 'src/js/_enqueues/lib/gallery.js' ,
'src/wp-admin/js/image-edit.js' : 'src/js/_enqueues/lib/image-edit.js' ,
'src/wp-admin/js/inline-edit-post.js' : 'src/js/_enqueues/admin/inline-edit-post.js' ,
'src/wp-admin/js/inline-edit-tax.js' : 'src/js/_enqueues/admin/inline-edit-tax.js' ,
'src/wp-admin/js/language-chooser.js' : 'src/js/_enqueues/lib/language-chooser.js' ,
'src/wp-admin/js/link.js' : 'src/js/_enqueues/admin/link.js' ,
'src/wp-admin/js/media-gallery.js' : 'src/js/_enqueues/deprecated/media-gallery.js' ,
'src/wp-admin/js/media-upload.js' : 'src/js/_enqueues/admin/media-upload.js' ,
'src/wp-admin/js/media.js' : 'src/js/_enqueues/admin/media.js' ,
'src/wp-admin/js/nav-menu.js' : 'src/js/_enqueues/lib/nav-menu.js' ,
'src/wp-admin/js/password-strength-meter.js' : 'src/js/_enqueues/wp/password-strength-meter.js' ,
'src/wp-admin/js/plugin-install.js' : 'src/js/_enqueues/admin/plugin-install.js' ,
'src/wp-admin/js/post.js' : 'src/js/_enqueues/admin/post.js' ,
'src/wp-admin/js/postbox.js' : 'src/js/_enqueues/admin/postbox.js' ,
'src/wp-admin/js/revisions.js' : 'src/js/_enqueues/wp/revisions.js' ,
'src/wp-admin/js/set-post-thumbnail.js' : 'src/js/_enqueues/admin/set-post-thumbnail.js' ,
'src/wp-admin/js/svg-painter.js' : 'src/js/_enqueues/wp/svg-painter.js' ,
'src/wp-admin/js/tags-box.js' : 'src/js/_enqueues/admin/tags-box.js' ,
'src/wp-admin/js/tags-suggest.js' : 'src/js/_enqueues/admin/tags-suggest.js' ,
'src/wp-admin/js/tags.js' : 'src/js/_enqueues/admin/tags.js' ,
'src/wp-admin/js/theme-plugin-editor.js' : 'src/js/_enqueues/wp/theme-plugin-editor.js' ,
'src/wp-admin/js/theme.js' : 'src/js/_enqueues/wp/theme.js' ,
'src/wp-admin/js/updates.js' : 'src/js/_enqueues/wp/updates.js' ,
'src/wp-admin/js/user-profile.js' : 'src/js/_enqueues/admin/user-profile.js' ,
'src/wp-admin/js/user-suggest.js' : 'src/js/_enqueues/lib/user-suggest.js' ,
'src/wp-admin/js/widgets/custom-html-widgets.js' : 'src/js/_enqueues/wp/widgets/custom-html.js' ,
'src/wp-admin/js/widgets/media-audio-widget.js' : 'src/js/_enqueues/wp/widgets/media-audio.js' ,
'src/wp-admin/js/widgets/media-gallery-widget.js' : 'src/js/_enqueues/wp/widgets/media-gallery.js' ,
'src/wp-admin/js/widgets/media-image-widget.js' : 'src/js/_enqueues/wp/widgets/media-image.js' ,
'src/wp-admin/js/widgets/media-video-widget.js' : 'src/js/_enqueues/wp/widgets/media-video.js' ,
'src/wp-admin/js/widgets/media-widgets.js' : 'src/js/_enqueues/wp/widgets/media.js' ,
'src/wp-admin/js/widgets/text-widgets.js' : 'src/js/_enqueues/wp/widgets/text.js' ,
'src/wp-admin/js/widgets.js' : 'src/js/_enqueues/admin/widgets.js' ,
'src/wp-admin/js/word-count.js' : 'src/js/_enqueues/wp/utils/word-count.js' ,
'src/wp-admin/js/wp-fullscreen-stub.js' : 'src/js/_enqueues/deprecated/fullscreen-stub.js' ,
'src/wp-admin/js/xfn.js' : 'src/js/_enqueues/admin/xfn.js' ,
'src/wp-includes/js/admin-bar.js' : 'src/js/_enqueues/lib/admin-bar.js' ,
'src/wp-includes/js/api-request.js' : 'src/js/_enqueues/wp/api-request.js' ,
'src/wp-includes/js/autosave.js' : 'src/js/_enqueues/wp/autosave.js' ,
'src/wp-includes/js/comment-reply.js' : 'src/js/_enqueues/lib/comment-reply.js' ,
'src/wp-includes/js/customize-base.js' : 'src/js/_enqueues/wp/customize/base.js' ,
'src/wp-includes/js/customize-loader.js' : 'src/js/_enqueues/wp/customize/loader.js' ,
'src/wp-includes/js/customize-models.js' : 'src/js/_enqueues/wp/customize/models.js' ,
'src/wp-includes/js/customize-preview-nav-menus.js' : 'src/js/_enqueues/wp/customize/preview-nav-menus.js' ,
'src/wp-includes/js/customize-preview-widgets.js' : 'src/js/_enqueues/wp/customize/preview-widgets.js' ,
'src/wp-includes/js/customize-preview.js' : 'src/js/_enqueues/wp/customize/preview.js' ,
'src/wp-includes/js/customize-selective-refresh.js' : 'src/js/_enqueues/wp/customize/selective-refresh.js' ,
'src/wp-includes/js/customize-views.js' : 'src/js/_enqueues/wp/customize/views.js' ,
'src/wp-includes/js/heartbeat.js' : 'src/js/_enqueues/wp/heartbeat.js' ,
'src/wp-includes/js/mce-view.js' : 'src/js/_enqueues/wp/mce-view.js' ,
'src/wp-includes/js/media-editor.js' : 'src/js/_enqueues/wp/media/editor.js' ,
'src/wp-includes/js/quicktags.js' : 'src/js/_enqueues/lib/quicktags.js' ,
'src/wp-includes/js/shortcode.js' : 'src/js/_enqueues/wp/shortcode.js' ,
'src/wp-includes/js/utils.js' : 'src/js/_enqueues/lib/cookies.js' ,
'src/wp-includes/js/wp-ajax-response.js' : 'src/js/_enqueues/lib/ajax-response.js' ,
'src/wp-includes/js/wp-api.js' : 'src/js/_enqueues/wp/api.js' ,
'src/wp-includes/js/wp-auth-check.js' : 'src/js/_enqueues/lib/auth-check.js' ,
'src/wp-includes/js/wp-backbone.js' : 'src/js/_enqueues/wp/backbone.js' ,
'src/wp-includes/js/wp-custom-header.js' : 'src/js/_enqueues/wp/custom-header.js' ,
'src/wp-includes/js/wp-embed-template.js' : 'src/js/_enqueues/lib/embed-template.js' ,
'src/wp-includes/js/wp-embed.js' : 'src/js/_enqueues/wp/embed.js' ,
'src/wp-includes/js/wp-emoji-loader.js' : 'src/js/_enqueues/lib/emoji-loader.js' ,
'src/wp-includes/js/wp-emoji.js' : 'src/js/_enqueues/wp/emoji.js' ,
'src/wp-includes/js/wp-list-revisions.js' : 'src/js/_enqueues/lib/list-revisions.js' ,
'src/wp-includes/js/wp-lists.js' : 'src/js/_enqueues/lib/lists.js' ,
'src/wp-includes/js/wp-pointer.js' : 'src/js/_enqueues/lib/pointer.js' ,
'src/wp-includes/js/wp-sanitize.js' : 'src/js/_enqueues/wp/sanitize.js' ,
'src/wp-includes/js/wp-util.js' : 'src/js/_enqueues/wp/util.js' ,
'src/wp-includes/js/wpdialog.js' : 'src/js/_enqueues/lib/dialog.js' ,
'src/wp-includes/js/wplink.js' : 'src/js/_enqueues/lib/link.js' ,
'src/wp-includes/js/zxcvbn-async.js' : 'src/js/_enqueues/lib/zxcvbn-async.js' ,
'src/wp-includes/js/media/controllers/audio-details.js' : 'src/js/media/controllers/audio-details.js' ,
'src/wp-includes/js/media/controllers/collection-add.js' : 'src/js/media/controllers/collection-add.js' ,
'src/wp-includes/js/media/controllers/collection-edit.js' : 'src/js/media/controllers/collection-edit.js' ,
'src/wp-includes/js/media/controllers/cropper.js' : 'src/js/media/controllers/cropper.js' ,
'src/wp-includes/js/media/controllers/customize-image-cropper.js' : 'src/js/media/controllers/customize-image-cropper.js' ,
'src/wp-includes/js/media/controllers/edit-attachment-metadata.js' : 'src/js/media/controllers/edit-attachment-metadata.js' ,
'src/wp-includes/js/media/controllers/edit-image.js' : 'src/js/media/controllers/edit-image.js' ,
'src/wp-includes/js/media/controllers/embed.js' : 'src/js/media/controllers/embed.js' ,
'src/wp-includes/js/media/controllers/featured-image.js' : 'src/js/media/controllers/featured-image.js' ,
'src/wp-includes/js/media/controllers/gallery-add.js' : 'src/js/media/controllers/gallery-add.js' ,
'src/wp-includes/js/media/controllers/gallery-edit.js' : 'src/js/media/controllers/gallery-edit.js' ,
'src/wp-includes/js/media/controllers/image-details.js' : 'src/js/media/controllers/image-details.js' ,
'src/wp-includes/js/media/controllers/library.js' : 'src/js/media/controllers/library.js' ,
'src/wp-includes/js/media/controllers/media-library.js' : 'src/js/media/controllers/media-library.js' ,
'src/wp-includes/js/media/controllers/region.js' : 'src/js/media/controllers/region.js' ,
'src/wp-includes/js/media/controllers/replace-image.js' : 'src/js/media/controllers/replace-image.js' ,
'src/wp-includes/js/media/controllers/site-icon-cropper.js' : 'src/js/media/controllers/site-icon-cropper.js' ,
'src/wp-includes/js/media/controllers/state-machine.js' : 'src/js/media/controllers/state-machine.js' ,
'src/wp-includes/js/media/controllers/state.js' : 'src/js/media/controllers/state.js' ,
'src/wp-includes/js/media/controllers/video-details.js' : 'src/js/media/controllers/video-details.js' ,
'src/wp-includes/js/media/models/attachment.js' : 'src/js/media/models/attachment.js' ,
'src/wp-includes/js/media/models/attachments.js' : 'src/js/media/models/attachments.js' ,
'src/wp-includes/js/media/models/post-image.js' : 'src/js/media/models/post-image.js' ,
'src/wp-includes/js/media/models/post-media.js' : 'src/js/media/models/post-media.js' ,
'src/wp-includes/js/media/models/query.js' : 'src/js/media/models/query.js' ,
'src/wp-includes/js/media/models/selection.js' : 'src/js/media/models/selection.js' ,
'src/wp-includes/js/media/routers/manage.js' : 'src/js/media/routers/manage.js' ,
'src/wp-includes/js/media/utils/selection-sync.js' : 'src/js/media/utils/selection-sync.js' ,
'src/wp-includes/js/media/views/attachment-compat.js' : 'src/js/media/views/attachment-compat.js' ,
'src/wp-includes/js/media/views/attachment-filters.js' : 'src/js/media/views/attachment-filters.js' ,
'src/wp-includes/js/media/views/attachment-filters/all.js' : 'src/js/media/views/attachment-filters/all.js' ,
'src/wp-includes/js/media/views/attachment-filters/date.js' : 'src/js/media/views/attachment-filters/date.js' ,
'src/wp-includes/js/media/views/attachment-filters/uploaded.js' : 'src/js/media/views/attachment-filters/uploaded.js' ,
'src/wp-includes/js/media/views/attachment.js' : 'src/js/media/views/attachment.js' ,
'src/wp-includes/js/media/views/attachment/details-two-column.js' : 'src/js/media/views/details-two-column.js' ,
'src/wp-includes/js/media/views/attachment/details.js' : 'src/js/media/views/details.js' ,
'src/wp-includes/js/media/views/attachment/edit-library.js' : 'src/js/media/views/edit-library.js' ,
'src/wp-includes/js/media/views/attachment/edit-selection.js' : 'src/js/media/views/edit-selection.js' ,
'src/wp-includes/js/media/views/attachment/library.js' : 'src/js/media/views/library.js' ,
'src/wp-includes/js/media/views/attachment/selection.js' : 'src/js/media/views/selection.js' ,
'src/wp-includes/js/media/views/attachment/attachments.js' : 'src/js/media/views/attachments.js' ,
'src/wp-includes/js/media/views/attachments/browser.js' : 'src/js/media/views/attachments/browser.js' ,
'src/wp-includes/js/media/views/attachments/selection.js' : 'src/js/media/views/attachments/selection.js' ,
'src/wp-includes/js/media/views/attachments/audio-details.js' : 'src/js/media/views/attachments/audio-details.js' ,
'src/wp-includes/js/media/views/attachments/button-group.js' : 'src/js/media/views/attachments/button-group.js' ,
'src/wp-includes/js/media/views/attachments/button.js' : 'src/js/media/views/attachments/button.js' ,
'src/wp-includes/js/media/views/button/delete-selected-permanently.js' : 'src/js/media/views/button/delete-selected-permanently.js' ,
'src/wp-includes/js/media/views/button/delete-selected.js' : 'src/js/media/views/button/delete-selected.js' ,
'src/wp-includes/js/media/views/button/select-mode-toggle.js' : 'src/js/media/views/button/select-mode-toggle.js' ,
'src/wp-includes/js/media/views/cropper.js' : 'src/js/media/views/cropper.js' ,
'src/wp-includes/js/media/views/edit-image-details.js' : 'src/js/media/views/edit-image-details.js' ,
'src/wp-includes/js/media/views/edit-image.js' : 'src/js/media/views/edit-image.js' ,
'src/wp-includes/js/media/views/embed.js' : 'src/js/media/views/embed.js' ,
'src/wp-includes/js/media/views/embed/image.js' : 'src/js/media/views/embed/image.js' ,
'src/wp-includes/js/media/views/embed/link.js' : 'src/js/media/views/embed/link.js' ,
'src/wp-includes/js/media/views/embed/url.js' : 'src/js/media/views/embed/url.js' ,
'src/wp-includes/js/media/views/focus-manager.js' : 'src/js/media/views/focus-manager.js' ,
'src/wp-includes/js/media/views/frame.js' : 'src/js/media/views/frame.js' ,
'src/wp-includes/js/media/views/frame/audio-details.js' : 'src/js/media/views/frame/audio-details.js' ,
'src/wp-includes/js/media/views/frame/edit-attachments.js' : 'src/js/media/views/frame/edit-attachments.js' ,
'src/wp-includes/js/media/views/frame/image-details.js' : 'src/js/media/views/frame/image-details.js' ,
'src/wp-includes/js/media/views/frame/manage.js' : 'src/js/media/views/frame/manage.js' ,
'src/wp-includes/js/media/views/frame/media-details.js' : 'src/js/media/views/frame/media-details.js' ,
'src/wp-includes/js/media/views/frame/post.js' : 'src/js/media/views/frame/post.js' ,
'src/wp-includes/js/media/views/frame/select.js' : 'src/js/media/views/frame/select.js' ,
'src/wp-includes/js/media/views/frame/video-details.js' : 'src/js/media/views/frame/video-details.js' ,
'src/wp-includes/js/media/views/iframe.js' : 'src/js/media/views/iframe.js' ,
'src/wp-includes/js/media/views/image-details.js' : 'src/js/media/views/image-details.js' ,
'src/wp-includes/js/media/views/label.js' : 'src/js/media/views/label.js' ,
'src/wp-includes/js/media/views/media-details.js' : 'src/js/media/views/media-details.js' ,
'src/wp-includes/js/media/views/media-frame.js' : 'src/js/media/views/media-frame.js' ,
'src/wp-includes/js/media/views/menu-item.js' : 'src/js/media/views/menu-item.js' ,
'src/wp-includes/js/media/views/menu.js' : 'src/js/media/views/menu.js' ,
'src/wp-includes/js/media/views/modal.js' : 'src/js/media/views/modal.js' ,
'src/wp-includes/js/media/views/priority-list.js' : 'src/js/media/views/priority-list.js' ,
'src/wp-includes/js/media/views/router-item.js' : 'src/js/media/views/router-item.js' ,
'src/wp-includes/js/media/views/router.js' : 'src/js/media/views/router.js' ,
'src/wp-includes/js/media/views/search.js' : 'src/js/media/views/search.js' ,
'src/wp-includes/js/media/views/selection.js' : 'src/js/media/views/selection.js' ,
'src/wp-includes/js/media/views/settings.js' : 'src/js/media/views/settings.js' ,
'src/wp-includes/js/media/views/settings/attachment-display.js' : 'src/js/media/views/settings/attachment-display.js' ,
'src/wp-includes/js/media/views/settings/gallery.js' : 'src/js/media/views/settings/gallery.js' ,
'src/wp-includes/js/media/views/settings/playlist.js' : 'src/js/media/views/settings/playlist.js' ,
'src/wp-includes/js/media/views/sidebar.js' : 'src/js/media/views/sidebar.js' ,
'src/wp-includes/js/media/views/site-icon-cropper.js' : 'src/js/media/views/site-icon-cropper.js' ,
'src/wp-includes/js/media/views/site-icon-preview.js' : 'src/js/media/views/site-icon-preview.js' ,
'src/wp-includes/js/media/views/spinner.js' : 'src/js/media/views/spinner.js' ,
'src/wp-includes/js/media/views/toolbar.js' : 'src/js/media/views/toolbar.js' ,
'src/wp-includes/js/media/views/toolbar/embed.js' : 'src/js/media/views/toolbar/embed.js' ,
'src/wp-includes/js/media/views/toolbar/select.js' : 'src/js/media/views/toolbar/select.js' ,
'src/wp-includes/js/media/views/uploader/editor.js' : 'src/js/media/views/uploader/editor.js' ,
'src/wp-includes/js/media/views/uploader/inline.js' : 'src/js/media/views/uploader/inline.js' ,
'src/wp-includes/js/media/views/uploader/status-error.js' : 'src/js/media/views/uploader/status-error.js' ,
'src/wp-includes/js/media/views/uploader/status.js' : 'src/js/media/views/uploader/status.js' ,
'src/wp-includes/js/media/views/uploader/window.js' : 'src/js/media/views/uploader/window.js' ,
'src/wp-includes/js/media/views/video-details.js' : 'src/js/media/views/video-details.js' ,
'src/wp-includes/js/media/views/view.js' : 'src/js/media/views/view.js'
}
}
} ,
2014-02-13 08:00:47 +00:00
imagemin : {
core : {
expand : true ,
cwd : SOURCE _DIR ,
src : [
'wp-{admin,includes}/images/**/*.{png,jpg,gif,jpeg}' ,
2024-01-22 11:41:33 +00:00
'wp-content/themes/**/*.{png,jpg,gif,jpeg}' ,
2014-02-13 08:00:47 +00:00
'wp-includes/js/tinymce/skins/wordpress/images/*.{png,jpg,gif,jpeg}'
] ,
dest : SOURCE _DIR
}
} ,
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
replace : {
2021-04-03 12:44:38 +00:00
'emoji-regex' : {
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
options : {
patterns : [
{
2017-10-03 07:11:28 +00:00
match : /\/\/ START: emoji arrays[\S\s]*\/\/ END: emoji arrays/g ,
2020-06-19 22:06:28 +00:00
replacement : function ( ) {
2024-03-04 11:23:59 +00:00
var regex , files , ghCli ,
2017-10-03 07:11:28 +00:00
partials , partialsSet ,
2024-03-04 11:23:59 +00:00
entities , emojiArray ,
apiResponse , query ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2017-10-03 07:11:28 +00:00
grunt . log . writeln ( 'Fetching list of Twemoji files...' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2024-03-04 11:23:59 +00:00
// Ensure that the GitHub CLI is installed.
ghCli = spawn ( 'gh' , [ '--version' ] ) ;
if ( 0 !== ghCli . status ) {
grunt . fatal ( 'Emoji precommit script requires GitHub CLI. See https://cli.github.com/.' ) ;
}
2020-01-29 00:43:23 +00:00
// Fetch a list of the files that Twemoji supplies.
2024-03-04 11:23:59 +00:00
query = 'query={repository(owner: "jdecked", name: "twemoji") {object(expression: "v15.0.3:assets/svg") {... on Tree {entries {name}}}}}' ;
files = spawn ( 'gh' , [ 'api' , 'graphql' , '-f' , query ] ) ;
2017-10-03 07:11:28 +00:00
if ( 0 !== files . status ) {
2024-11-21 13:16:07 +00:00
grunt . fatal ( files . stderr . toString ( ) ) ;
2017-10-03 07:11:28 +00:00
}
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2024-03-04 11:23:59 +00:00
try {
apiResponse = JSON . parse ( files . stdout . toString ( ) ) ;
} catch ( e ) {
grunt . fatal ( 'Unable to parse Twemoji file list' ) ;
}
entities = apiResponse . data . repository . object . entries ;
entities = entities . reduce ( function ( accumulator , val ) { return accumulator + val . name + '\n' ; } , '' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Tidy up the file list.
2019-08-08 04:04:15 +00:00
entities = entities . replace ( /\.svg/g , '' ) ;
2017-10-03 07:11:28 +00:00
entities = entities . replace ( /^$/g , '' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Convert the emoji entities to HTML entities.
2017-10-03 07:11:28 +00:00
partials = entities = entities . replace ( /([a-z0-9]+)/g , '&#x$1;' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Remove the hyphens between the HTML entities.
2017-10-03 07:11:28 +00:00
entities = entities . replace ( /-/g , '' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Sort the entities list by length, so the longest emoji will be found first.
2020-06-19 22:06:28 +00:00
emojiArray = entities . split ( '\n' ) . sort ( function ( a , b ) {
2017-10-03 07:11:28 +00:00
return b . length - a . length ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
} ) ;
2020-01-29 00:43:23 +00:00
// Convert the entities list to PHP array syntax.
2017-10-03 07:11:28 +00:00
entities = '\'' + emojiArray . filter ( function ( val ) {
return val . length >= 8 ? val : false ;
2018-01-25 01:05:01 +00:00
} ) . join ( '\', \'' ) + '\'' ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Create a list of all characters used by the emoji list.
2017-10-03 07:11:28 +00:00
partials = partials . replace ( /-/g , '\n' ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Set automatically removes duplicates.
2017-10-03 07:11:28 +00:00
partialsSet = new Set ( partials . split ( '\n' ) ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2020-01-29 00:43:23 +00:00
// Convert the partials list to PHP array syntax.
2017-10-03 07:11:28 +00:00
partials = '\'' + Array . from ( partialsSet ) . filter ( function ( val ) {
return val . length >= 8 ? val : false ;
2018-01-25 01:05:01 +00:00
} ) . join ( '\', \'' ) + '\'' ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2017-10-03 07:11:28 +00:00
regex = '// START: emoji arrays\n' ;
2018-01-25 01:05:01 +00:00
regex += '\t$entities = array( ' + entities + ' );\n' ;
regex += '\t$partials = array( ' + partials + ' );\n' ;
2017-10-03 07:11:28 +00:00
regex += '\t// END: emoji arrays' ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
return regex ;
}
}
]
} ,
files : [
{
expand : true ,
flatten : true ,
src : [
SOURCE _DIR + 'wp-includes/formatting.php'
] ,
dest : SOURCE _DIR + 'wp-includes/'
}
]
2020-06-19 22:06:28 +00:00
} ,
2021-04-03 12:44:38 +00:00
'source-maps' : {
2021-04-02 19:40:43 +00:00
options : {
patterns : [
{
2023-06-27 14:20:18 +00:00
match : new RegExp ( '\/\/# sourceMappingURL=.*\\s*' , 'g' ) ,
2021-04-02 19:40:43 +00:00
replacement : ''
}
]
} ,
files : [
{
expand : true ,
flatten : true ,
src : [
BUILD _DIR + 'wp-includes/js/underscore.js'
] ,
dest : BUILD _DIR + 'wp-includes/js/'
2023-06-27 14:20:18 +00:00
} ,
{
expand : true ,
flatten : true ,
src : [
BUILD _DIR + 'wp-includes/js/dist/block-editor.js' ,
2024-09-20 01:53:52 +00:00
BUILD _DIR + 'wp-includes/js/dist/commands.js' ,
2023-06-27 14:20:18 +00:00
] ,
dest : BUILD _DIR + 'wp-includes/js/dist/'
2021-04-02 19:40:43 +00:00
}
]
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
}
} ,
2015-03-05 19:48:59 +00:00
_watch : {
2018-05-27 18:46:15 +00:00
options : {
interval : 2000
} ,
2013-08-07 05:25:25 +00:00
all : {
files : [
SOURCE _DIR + '**' ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'!' + SOURCE _DIR + 'js/**/*.js' ,
2013-08-07 05:25:25 +00:00
// Ignore version control directories.
'!' + SOURCE _DIR + '**/.{svn,git}/**'
] ,
tasks : [ 'clean:dynamic' , 'copy:dynamic' ] ,
options : {
dot : true ,
2018-05-27 18:46:15 +00:00
spawn : false
2013-08-07 05:25:25 +00:00
}
2013-08-30 04:06:34 +00:00
} ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'js-enqueues' : {
files : [ SOURCE _DIR + 'js/_enqueues/**/*.js' ] ,
2023-07-17 14:05:51 +00:00
tasks : [ 'clean:dynamic' , 'copy:dynamic-js' , 'uglify:dynamic' ] ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
options : {
dot : true ,
2018-05-27 18:46:15 +00:00
spawn : false
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
} ,
'js-webpack' : {
files : [
SOURCE _DIR + 'js/**/*.js' ,
'!' + SOURCE _DIR + 'js/_enqueues/**/*.js' ,
'webpack-dev.config.js'
] ,
2023-07-17 14:05:51 +00:00
tasks : [ 'clean:dynamic' , 'webpack:dev' , 'uglify:dynamic' ] ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
options : {
dot : true ,
2018-05-27 18:46:15 +00:00
spawn : false
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
} ,
2014-09-29 17:20:58 +00:00
config : {
2017-10-04 21:00:15 +00:00
files : [
'Gruntfile.js' ,
'webpack.config.js'
]
2014-09-29 17:20:58 +00:00
} ,
2013-11-13 23:37:30 +00:00
colors : {
2013-12-03 21:13:14 +00:00
files : [ SOURCE _DIR + 'wp-admin/css/colors/**' ] ,
2013-11-13 23:37:30 +00:00
tasks : [ 'sass:colors' ]
} ,
2013-11-12 21:18:45 +00:00
rtl : {
files : [
SOURCE _DIR + 'wp-admin/css/*.css' ,
SOURCE _DIR + 'wp-includes/css/*.css'
] ,
2015-02-27 13:40:03 +00:00
tasks : [ 'rtlcss:dynamic' ] ,
2013-11-12 21:18:45 +00:00
options : {
2018-05-27 18:46:15 +00:00
spawn : false
2013-11-12 21:18:45 +00:00
}
} ,
2013-08-30 04:06:34 +00:00
test : {
2014-02-10 01:11:25 +00:00
files : [
'tests/qunit/**' ,
'!tests/qunit/editor/**'
] ,
2013-08-30 04:06:34 +00:00
tasks : [ 'qunit' ]
2013-08-07 05:25:25 +00:00
}
}
} ) ;
2020-01-29 00:43:23 +00:00
// Allow builds to be minimal.
2016-10-20 22:23:21 +00:00
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 05:25:25 +00:00
// Register tasks.
2013-10-06 10:33:01 +00:00
2017-10-04 21:00:15 +00:00
// Webpack task.
grunt . loadNpmTasks ( 'grunt-webpack' ) ;
2013-11-12 21:18:45 +00:00
// RTL task.
2015-02-27 13:40:03 +00:00
grunt . registerTask ( 'rtl' , [ 'rtlcss:core' , 'rtlcss:colors' ] ) ;
2013-11-12 21:18:45 +00:00
2013-11-13 23:37:30 +00:00
// Color schemes task.
2015-07-08 19:53:22 +00: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 19:37:10 +00:00
2014-06-28 02:08:05 +00:00
// JSHint task.
2015-02-09 16:00:44 +00:00
grunt . registerTask ( 'jshint:corejs' , [
'jshint:grunt' ,
'jshint:tests' ,
'jshint:themes' ,
'jshint:core' ,
'jshint:media'
] ) ;
2014-06-28 02:08:05 +00:00
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 04:22:32 +00:00
grunt . registerTask ( 'restapi-jsclient' , [
'phpunit:restapi-jsclient' ,
2017-02-15 17:58:14 +00:00
'qunit:compiled'
REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.
The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.
Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.
Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.
Props jnylen0, welcher.
Fixes #39264.
git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 04:22:32 +00:00
] ) ;
2022-04-29 13:59:49 +00:00
grunt . registerTask ( 'sync-gutenberg-packages' , function ( ) {
if ( grunt . option ( 'update-browserlist' ) ) {
2022-04-29 14:44:15 +00:00
/ *
* Updating the browserlist database is opt - in and up to the release lead .
*
* Browserlist database should be updated :
* - In each release cycle up until RC1
* - If Webpack throws a warning about an outdated database
*
* It should not be updated :
* - After the RC1
* - When backporting fixes to older WordPress releases .
*
* For more context , see :
* https : //github.com/WordPress/wordpress-develop/pull/2621#discussion_r859840515
* https : //core.trac.wordpress.org/ticket/55559
* /
2022-04-29 13:59:49 +00:00
grunt . task . run ( 'browserslist:update' ) ;
}
// Install the latest version of the packages already listed in package.json.
grunt . task . run ( 'wp-packages:update' ) ;
2022-04-29 14:44:15 +00:00
/ *
* Install any new @ wordpress packages that are now required .
* Update any non - @ wordpress deps to the same version as required in the @ wordpress packages ( e . g . react 16 - > 17 ) .
* /
2022-04-29 13:59:49 +00:00
grunt . task . run ( 'wp-packages:refresh-deps' ) ;
} ) ;
2015-03-05 19:48:59 +00:00
grunt . renameTask ( 'watch' , '_watch' ) ;
2014-02-13 17:56:29 +00:00
2015-03-05 19:48:59 +00:00
grunt . registerTask ( 'watch' , function ( ) {
2017-10-04 21:00:15 +00:00
if ( ! this . args . length || this . args . indexOf ( 'webpack' ) > - 1 ) {
2018-12-16 23:33:38 +00:00
grunt . task . run ( 'build' ) ;
2015-03-05 19:48:59 +00:00
}
2018-06-08 04:40:18 +00:00
if ( 'watch:phpunit' === grunt . cli . tasks [ 0 ] || 'undefined' !== typeof grunt . option ( 'phpunit' ) ) {
grunt . config . data . _watch . phpunit = {
files : [ '**/*.php' ] ,
tasks : [ 'phpunit:default' ]
} ;
}
2015-03-05 19:48:59 +00:00
grunt . task . run ( '_' + this . nameArgs ) ;
} ) ;
2016-04-15 10:18:03 +00:00
grunt . registerTask ( 'precommit:image' , [
2016-03-09 20:54:10 +00:00
'imagemin:core'
] ) ;
grunt . registerTask ( 'precommit:js' , [
2017-10-04 21:00:15 +00:00
'webpack:prod' ,
2015-03-05 19:48:59 +00:00
'jshint:corejs' ,
2018-04-03 19:45:39 +00:00
'uglify:imgareaselect' ,
2019-02-14 00:06:39 +00:00
'uglify:jqueryform' ,
2020-06-17 17:38:40 +00:00
'uglify:moment' ,
2015-03-13 21:08:14 +00:00
'qunit:compiled'
2015-03-05 19:48:59 +00:00
] ) ;
2016-03-09 20:54:10 +00:00
grunt . registerTask ( 'precommit:css' , [
'postcss:core'
] ) ;
grunt . registerTask ( 'precommit:php' , [
'phpunit'
] ) ;
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
grunt . registerTask ( 'precommit:emoji' , [
2021-04-03 12:44:38 +00:00
'replace:emoji-regex'
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
] ) ;
2016-03-09 20:54:10 +00:00
grunt . registerTask ( 'precommit' , 'Runs test and build tasks in preparation for a commit' , function ( ) {
var done = this . async ( ) ;
2016-04-12 22:33:18 +00: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 {
2017-10-03 15:19:23 +00:00
runAllTasks ( ) ;
2016-03-09 20:54:10 +00:00
}
}
2016-04-12 22:33:18 +00:00
2017-10-03 15:19:23 +00:00
function runAllTasks ( ) {
grunt . log . writeln ( 'Cannot determine which files are modified as SVN and GIT are not available.' ) ;
grunt . log . writeln ( 'Running all tasks and all tests.' ) ;
grunt . task . run ( [
2018-08-17 01:50:26 +00:00
'format:php' ,
2017-10-03 15:19:23 +00:00
'precommit:js' ,
'precommit:css' ,
'precommit:image' ,
'precommit:emoji' ,
'precommit:php'
] ) ;
done ( ) ;
}
2016-04-12 22:33:18 +00:00
function run ( type ) {
var command = map [ type ] . split ( ' ' ) ;
grunt . util . spawn ( {
cmd : command . shift ( ) ,
args : command
} , function ( error , result , code ) {
2016-04-15 10:18:03 +00:00
var taskList = [ ] ;
2016-06-19 12:31:15 +00: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 ) ;
}
2017-10-03 15:19:23 +00:00
if ( code === 0 ) {
2018-08-17 01:50:26 +00:00
if ( [ 'package.json' , 'Gruntfile.js' , 'composer.json' ] . some ( testPath ) ) {
2017-10-03 15:19:23 +00:00
grunt . log . writeln ( 'Configuration files modified. Running `prerelease`.' ) ;
taskList . push ( 'prerelease' ) ;
} else {
if ( [ 'png' , 'jpg' , 'gif' , 'jpeg' ] . some ( testExtension ) ) {
grunt . log . writeln ( 'Image files modified. Minifying.' ) ;
taskList . push ( 'precommit:image' ) ;
2016-06-07 03:32:22 +00:00
}
Emoji: Port the Twemoji regex to PHP.
Previously, `wp_encode_emoji()` and `wp_staticize_emoji()` used inaccurate regular expressions to find emoji, and transform then into HTML entities or `<img>`s, respectively. This would result in emoji not being correctly transformed, or occasionally, non-emoji being incorrectly transformed.
This commit adds a new `grunt` task - `grunt precommit:emoji`. It finds the regex in `twemoji.js`, transforms it into a PHP-friendly version, and adds it to `formatting.php`. This task is also automatically run by `grunt precommit`, when it detects that `twemoji.js` has changed.
The new regex requires features introduced in PCRE 8.32, which was introduced in PHP 5.4.14, though it was also backported to later releases of the PHP 5.3 series. For versions of PHP that don't support this, it will fall back to an updated version of the loose-matching regex.
For short posts, the performance difference between the old and new regex is negligible. As the posts get longer, however, the new method is exponentially faster.
Fixes #35293.
git-svn-id: https://develop.svn.wordpress.org/trunk@41043 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-14 05:46:19 +00:00
2017-10-03 15:19:23 +00:00
[ 'js' , 'css' , 'php' ] . forEach ( function ( extension ) {
if ( testExtension ( extension ) ) {
grunt . log . writeln ( extension . toUpperCase ( ) + ' files modified. ' + extension . toUpperCase ( ) + ' tests will be run.' ) ;
taskList . push ( 'precommit:' + extension ) ;
}
} ) ;
2016-04-12 22:33:18 +00:00
2017-10-03 15:19:23 +00:00
if ( [ 'twemoji.js' ] . some ( testPath ) ) {
grunt . log . writeln ( 'twemoji.js has updated. Running `precommit:emoji.' ) ;
taskList . push ( 'precommit:emoji' ) ;
}
2018-08-17 01:50:26 +00:00
if ( testExtension ( 'php' ) ) {
grunt . log . writeln ( 'PHP files modified. Code formatting will be run.' ) ;
var PHPfiles = result . stdout . split ( '\n' ) ;
// Find .php files that have been modified or added.
PHPfiles = PHPfiles . filter ( function ( file ) {
return /^\s*[MA]\s*.*\.php$/ . test ( file ) ;
} ) ;
PHPfiles = PHPfiles . map ( function ( file ) {
return file . replace ( /^\s*[MA]\s*/ , '' ) ;
} ) ;
changedFiles = {
php : PHPfiles
} ;
taskList . push ( 'format:php' ) ;
}
2017-10-03 15:19:23 +00:00
}
2016-04-12 22:33:18 +00:00
2017-10-03 15:19:23 +00:00
grunt . task . run ( taskList ) ;
done ( ) ;
} else {
runAllTasks ( ) ;
}
2016-04-12 22:33:18 +00:00
} ) ;
}
} ) ;
2016-03-09 20:54:10 +00:00
Editor: Improve block loading PHP performance.
This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.
Includes:
* Adding a new Grunt task to convert `block.json` files to `block-json.php`.
* Using the new `block-json.php` file in the `register_block_type_from_metadata()` function.
Follow-up to [48141].
Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes #55005.
git-svn-id: https://develop.svn.wordpress.org/trunk@54276 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-21 13:55:25 +00:00
grunt . registerTask ( 'copy:block-json' , 'Copies block.json file contents to block-json.php.' , function ( ) {
var blocks = { } ;
grunt . file . recurse ( SOURCE _DIR + 'wp-includes/blocks' , function ( abspath , rootdir , subdir , filename ) {
if ( /^block\.json$/ . test ( filename ) ) {
blocks [ subdir ] = grunt . file . readJSON ( abspath ) ;
}
} ) ;
grunt . file . write (
SOURCE _DIR + 'wp-includes/blocks/blocks-json.php' ,
2023-06-27 14:20:18 +00:00
'<?php return ' + json2php . make ( {
linebreak : '\n' ,
indent : ' ' ,
shortArraySyntax : false
} ) ( blocks ) + ';'
Editor: Improve block loading PHP performance.
This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.
Includes:
* Adding a new Grunt task to convert `block.json` files to `block-json.php`.
* Using the new `block-json.php` file in the `register_block_type_from_metadata()` function.
Follow-up to [48141].
Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes #55005.
git-svn-id: https://develop.svn.wordpress.org/trunk@54276 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-21 13:55:25 +00:00
) ;
} ) ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
grunt . registerTask ( 'copy:js' , [
'copy:npm-packages' ,
'copy:vendor-js' ,
'copy:admin-js' ,
'copy:includes-js'
] ) ;
2018-12-16 23:33:38 +00:00
grunt . registerTask ( 'uglify:all' , [
'uglify:core' ,
2020-10-07 16:31:53 +00:00
'uglify:jquery-ui' ,
2019-02-14 00:06:39 +00:00
'uglify:imgareaselect' ,
2020-06-17 17:38:40 +00:00
'uglify:jqueryform' ,
'uglify:moment'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
] ) ;
2020-01-03 13:15:33 +00:00
grunt . registerTask ( 'build:webpack' , [
2020-03-18 04:48:19 +00:00
'clean:webpack-assets' ,
2018-12-24 13:28:22 +00:00
'webpack:prod' ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'webpack:dev' ,
2023-09-26 14:20:18 +00:00
'clean:interactivity-assets' ,
2020-01-03 13:15:33 +00:00
] ) ;
grunt . registerTask ( 'build:js' , [
'clean:js' ,
'build:webpack' ,
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
'copy:js' ,
'file_append' ,
'uglify:all' ,
2019-01-18 19:50:19 +00:00
'concat:tinymce' ,
2023-07-17 14:05:51 +00:00
'concat:emoji'
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
] ) ;
2018-12-24 13:28:22 +00:00
grunt . registerTask ( 'build:css' , [
'clean:css' ,
2018-12-16 23:33:38 +00:00
'copy:wp-admin-css-compat-rtl' ,
'copy:wp-admin-css-compat-min' ,
2015-03-05 19:48:59 +00:00
'cssmin:core' ,
'colors' ,
'rtl' ,
'cssmin:rtl' ,
'cssmin:colors' ,
2018-12-24 13:28:22 +00:00
'usebanner'
] ) ;
grunt . registerTask ( 'build:files' , [
'clean:files' ,
'copy:files' ,
Editor: Improve block loading PHP performance.
This commit improves PHP performance for core blocks by reading a single PHP file with block metadata, instead of reading a JSON file per-block and then decoding from JSON to PHP.
Includes:
* Adding a new Grunt task to convert `block.json` files to `block-json.php`.
* Using the new `block-json.php` file in the `register_block_type_from_metadata()` function.
Follow-up to [48141].
Props aristath, gziolo, johnbillion, presstoke, mukesh27, hellofromTonya, petitphp, adamsilverstein, costdev, desrosj, SergeyBiryukov.
Fixes #55005.
git-svn-id: https://develop.svn.wordpress.org/trunk@54276 602fd350-edb4-49c9-b593-d223f7449a82
2022-09-21 13:55:25 +00:00
'copy:block-json' ,
2018-12-24 13:28:22 +00:00
'copy:version' ,
2015-03-05 19:48:59 +00:00
] ) ;
2013-08-07 05:25:25 +00:00
2021-02-26 14:07:53 +00:00
/ * *
* Build verification tasks .
* /
grunt . registerTask ( 'verify:build' , [
'verify:old-files' ,
'verify:source-maps' ,
] ) ;
/ * *
* Build assertions to ensure no project files are inside ` $ _old_files ` in the build directory .
*
* @ ticket 36083
* /
grunt . registerTask ( 'verify:old-files' , function ( ) {
const file = ` ${ BUILD _DIR } wp-admin/includes/update-core.php ` ;
assert (
fs . existsSync ( file ) ,
'The build/wp-admin/includes/update-core.php file does not exist.'
) ;
const contents = fs . readFileSync ( file , {
encoding : 'utf8' ,
} ) ;
assert (
contents . length > 0 ,
'The build/wp-admin/includes/update-core.php file must not be empty.'
) ;
const match = contents . match ( /\$_old_files = array\(([^\)]+)\);/ ) ;
assert (
match . length > 0 ,
'The build/wp-admin/includes/update-core.php file does not include an `$_old_files` array.'
) ;
const files = match [ 1 ] . split ( '\n\t' ) . filter ( function ( file ) {
2022-04-29 14:44:15 +00:00
// Filter out empty lines.
2021-02-26 14:07:53 +00:00
if ( '' === file ) {
return false ;
}
2022-04-29 14:44:15 +00:00
// Filter out commented out lines.
2021-02-26 14:07:53 +00:00
if ( 0 === file . indexOf ( '/' ) ) {
return false ;
}
return true ;
} ) . map ( function ( file ) {
2022-04-29 14:44:15 +00:00
// Strip leading and trailing single quotes and commas.
2021-02-26 14:07:53 +00:00
return file . replace ( /^\'|\',$/g , '' ) ;
} ) ;
files . forEach ( function ( file ) {
const search = ` ${ BUILD _DIR } ${ file } ` ;
assert (
false === fs . existsSync ( search ) ,
` ${ search } should not be present in the $ _old_files array. `
) ;
} ) ;
} ) ;
/ * *
2024-01-31 08:29:18 +00:00
* Compiled JavaScript files may link to sourcemaps . In some cases ,
* the source map may not be available , which can cause 404 errors when
* browsers try to download the sourcemap from the referenced URLs .
* Ensure that sourcemap links are not included in JavaScript files .
2021-02-26 14:07:53 +00:00
*
* @ ticket 24994
* @ ticket 46218
2024-01-31 08:29:18 +00:00
* @ ticket 60348
2021-02-26 14:07:53 +00:00
* /
grunt . registerTask ( 'verify:source-maps' , function ( ) {
2021-11-08 14:26:27 +00:00
const ignoredFiles = [
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
git-svn-id: https://develop.svn.wordpress.org/trunk@57377 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-29 21:04:18 +00:00
'build/wp-includes/js/dist/components.js' ,
2021-11-08 14:26:27 +00:00
] ;
2021-06-16 22:56:32 +00:00
const files = buildFiles . reduce ( ( acc , path ) => {
// Skip excluded paths and any path that isn't a file.
if ( '!' === path [ 0 ] || '**' !== path . substr ( - 2 ) ) {
return acc ;
}
acc . push ( ... glob . sync ( ` ${ BUILD _DIR } / ${ path } /*.js ` ) ) ;
return acc ;
} , [ ] ) ;
2021-02-26 14:07:53 +00:00
assert (
files . length > 0 ,
'No JavaScript files found in the build directory.'
) ;
2021-11-08 14:26:27 +00:00
files
. filter ( file => ! ignoredFiles . includes ( file ) )
. forEach ( function ( file ) {
const contents = fs . readFileSync ( file , {
encoding : 'utf8' ,
} ) ;
// `data:` URLs are allowed:
2024-01-31 08:29:18 +00:00
const doesNotHaveSourceMap = ! /^\/\/# sourceMappingURL=((?!data:).)/m . test ( contents ) ;
2021-02-26 14:07:53 +00:00
2021-11-08 14:26:27 +00:00
assert (
2024-01-31 08:29:18 +00:00
doesNotHaveSourceMap ,
2021-11-08 14:26:27 +00:00
` The ${ file } file must not contain a sourceMappingURL. `
) ;
} ) ;
2021-02-26 14:07:53 +00:00
} ) ;
2018-12-24 13:28:22 +00:00
grunt . registerTask ( 'build' , function ( ) {
if ( grunt . option ( 'dev' ) ) {
grunt . task . run ( [
'build:js' ,
'build:css' ,
] ) ;
} else {
grunt . task . run ( [
'build:files' ,
'build:js' ,
'build:css' ,
2021-04-03 12:44:38 +00:00
'replace:source-maps' ,
2021-02-26 14:07:53 +00:00
'verify:build'
2018-12-24 13:28:22 +00:00
] ) ;
}
} ) ;
2016-03-10 05:36:15 +00:00
grunt . registerTask ( 'prerelease' , [
2018-08-17 01:50:26 +00:00
'format:php:error' ,
2016-03-10 05:36:15 +00:00
'precommit:php' ,
'precommit:js' ,
'precommit:css' ,
2016-04-15 10:18:03 +00:00
'precommit:image'
2016-03-10 05:36:15 +00:00
] ) ;
2013-11-09 20:43:58 +00:00
// Testing tasks.
2021-05-25 23:14:15 +00:00
grunt . registerMultiTask ( 'phpunit' , 'Runs PHPUnit tests, including the ajax, external-http, and multisite tests.' , function ( ) {
var args = phpUnitWatchGroup ? this . data . args . concat ( [ '--group' , phpUnitWatchGroup ] ) : this . data . args ;
args . unshift ( 'test' , '--' ) ;
2013-11-09 21:25:02 +00:00
grunt . util . spawn ( {
2021-05-25 23:14:15 +00:00
cmd : 'composer' ,
args : args ,
opts : { stdio : 'inherit' }
2013-11-09 21:25:02 +00:00
} , this . async ( ) ) ;
2013-11-09 21:18:23 +00:00
} ) ;
2021-05-25 23:14:15 +00:00
grunt . registerTask ( 'qunit:compiled' , 'Runs QUnit tests on compiled as well as uncompiled scripts.' ,
[ '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-28 23:52:04 +00:00
2021-05-25 23:14:15 +00:00
grunt . registerTask ( 'test' , 'Runs all QUnit and PHPUnit tasks.' , [ 'qunit:compiled' , 'phpunit' ] ) ;
2014-06-21 20:05:19 +00:00
2018-08-17 01:50:26 +00:00
grunt . registerTask ( 'format:php' , 'Runs the code formatter on changed files.' , function ( ) {
var done = this . async ( ) ;
var flags = this . flags ;
var args = changedFiles . php ;
2021-05-25 23:14:15 +00:00
2018-08-17 01:50:26 +00:00
args . unshift ( 'format' ) ;
2021-05-25 23:14:15 +00:00
2018-08-17 01:50:26 +00:00
grunt . util . spawn ( {
cmd : 'composer' ,
args : args ,
opts : { stdio : 'inherit' }
} , function ( error ) {
if ( flags . error && error ) {
done ( false ) ;
} else {
done ( true ) ;
}
} ) ;
} ) ;
2019-07-08 00:55:20 +00:00
grunt . registerTask ( 'lint:php' , 'Runs the code linter on changed files.' , function ( ) {
var done = this . async ( ) ;
var flags = this . flags ;
var args = changedFiles . php ;
2021-04-10 12:05:50 +00:00
args . unshift ( 'lint' ) ;
2019-07-08 00:55:20 +00:00
grunt . util . spawn ( {
cmd : 'composer' ,
args : args ,
opts : { stdio : 'inherit' }
} , function ( error ) {
if ( flags . error && error ) {
done ( false ) ;
} else {
done ( true ) ;
}
} ) ;
} ) ;
2022-04-29 13:59:49 +00:00
grunt . registerTask ( 'wp-packages:update' , 'Update WordPress packages' , function ( ) {
const distTag = grunt . option ( 'dist-tag' ) || 'latest' ;
grunt . log . writeln ( ` Updating WordPress packages (--dist-tag= ${ distTag } ) ` ) ;
2022-05-02 10:36:45 +00:00
spawn ( 'npx' , [ 'wp-scripts' , 'packages-update' , ` --dist-tag= ${ distTag } ` ] , {
2022-04-29 13:59:49 +00:00
cwd : _ _dirname ,
stdio : 'inherit' ,
} ) ;
} ) ;
grunt . registerTask ( 'browserslist:update' , 'Update the local database of browser supports' , function ( ) {
grunt . log . writeln ( ` Updating browsers list ` ) ;
spawn ( 'npx' , [ 'browserslist@latest' , '--update-db' ] , {
cwd : _ _dirname ,
stdio : 'inherit' ,
} ) ;
} ) ;
grunt . registerTask ( 'wp-packages:refresh-deps' , 'Update version of dependencies in package.json to match the ones listed in the latest WordPress packages' , function ( ) {
const distTag = grunt . option ( 'dist-tag' ) || 'latest' ;
grunt . log . writeln ( ` Updating versions of dependencies listed in package.json (--dist-tag= ${ distTag } ) ` ) ;
spawn ( 'node' , [ 'tools/release/sync-gutenberg-packages.js' , ` --dist-tag= ${ distTag } ` ] , {
cwd : _ _dirname ,
stdio : 'inherit' ,
} ) ;
} ) ;
2022-07-08 12:32:37 +00:00
grunt . registerTask ( 'wp-packages:sync-stable-blocks' , 'Refresh the PHP files referring to stable @wordpress/block-library blocks.' , function ( ) {
grunt . log . writeln ( ` Syncing stable blocks from @wordpress/block-library to src/ ` ) ;
const { main } = require ( './tools/release/sync-stable-blocks' ) ;
main ( ) ;
} ) ;
2014-02-26 21:45:55 +00:00
// Patch task.
grunt . renameTask ( 'patch_wordpress' , 'patch' ) ;
2016-11-10 03:21:39 +00:00
// Add an alias `apply` of the `patch` task name.
grunt . registerTask ( 'apply' , 'patch' ) ;
2013-08-07 05:25:25 +00:00
// Default task.
grunt . registerTask ( 'default' , [ 'build' ] ) ;
2015-09-09 02:11:23 +00:00
/ *
* Automatically updates the ` :dynamic ` configurations
* so that only the changed files are updated .
* /
2018-05-29 14:20:44 +00:00
grunt . event . on ( 'watch' , function ( action , filepath , target ) {
2015-09-09 02:11:23 +00:00
var src ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
// Only configure the dynamic tasks based on known targets.
if ( [ 'all' , 'rtl' , 'webpack' , 'js-enqueues' , 'js-webpack' ] . indexOf ( target ) === - 1 ) {
2013-08-30 22:16:43 +00:00
return ;
2013-10-27 21:53:11 +00:00
}
2013-08-30 22:16:43 +00:00
2018-05-29 14:20:44 +00:00
// Normalize filepath for Windows.
filepath = filepath . replace ( /\\/g , '/' ) ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
// If the target is a file in the restructured js src.
if ( target === 'js-enqueues' ) {
var files = { } ;
var configs , dest ;
// If it's a vendor file which are configured with glob matchers.
if ( filepath . indexOf ( SOURCE _DIR + 'js/_enqueues/vendor/' ) === 0 ) {
// Grab the glob matchers from the copy task.
configs = grunt . config ( [ 'copy' , 'vendor-js' , 'files' ] ) ;
// For each glob matcher check if it matches and if so set the variables for our dynamic tasks.
for ( var i = 0 ; i < configs . length ; i ++ ) {
var config = configs [ i ] ;
var relative = path . relative ( config . cwd , filepath ) ;
var minimatch = require ( 'minimatch' ) ;
if ( minimatch . match ( config . src , relative , { } ) ) {
dest = config . dest + relative ;
2018-12-24 13:28:22 +00:00
src = [ path . relative ( WORKING _DIR , dest ) ] ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
files [ dest ] = [ filepath ] ;
break ;
}
}
// Or if it's another file which has a straight mapping.
} else {
configs = Object . assign ( { } ,
grunt . config ( [ 'copy' , 'admin-js' , 'files' ] ) ,
grunt . config ( [ 'copy' , 'includes-js' , 'files' ] )
) ;
2018-05-29 14:20:44 +00:00
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
for ( dest in configs ) {
// If a file in the mapping matches then set the variables for our dynamic tasks.
2018-05-29 14:20:44 +00:00
if ( dest && configs . hasOwnProperty ( dest ) && configs [ dest ] [ 0 ] === './' + filepath ) {
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
files [ dest ] = configs [ dest ] ;
2018-12-24 13:28:22 +00:00
src = [ path . relative ( WORKING _DIR , dest ) ] ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
break ;
}
}
}
// Configure our dynamic-js copy task which uses a file mapping rather than simply copying from src to build.
if ( action !== 'deleted' ) {
grunt . config ( [ 'copy' , 'dynamic-js' , 'files' ] , files ) ;
}
2023-07-17 14:05:51 +00:00
// For the webpack builds configure the task to only check those files built by webpack.
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
} else if ( target === 'js-webpack' ) {
src = [
'wp-includes/js/media-audiovideo.js' ,
'wp-includes/js/media-grid.js' ,
'wp-includes/js/media-models.js' ,
'wp-includes/js/media-views.js'
] ;
// Else simply use the path relative to the source directory.
} else {
src = [ path . relative ( SOURCE _DIR , filepath ) ] ;
}
2015-10-07 00:00:00 +00:00
2018-05-29 14:20:44 +00:00
if ( ! src ) {
grunt . warn ( 'Failed to determine the destination file.' ) ;
return ;
}
2015-09-09 02:11:23 +00:00
if ( action === 'deleted' ) {
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
// Clean up only those files that were deleted.
2015-09-09 02:11:23 +00:00
grunt . config ( [ 'clean' , 'dynamic' , 'src' ] , src ) ;
} else {
2023-08-24 20:40:24 +00:00
if ( ! grunt . option ( 'dev' ) ) {
// Otherwise copy over only the changed file.
grunt . config ( [ 'copy' , 'dynamic' , 'src' ] , src ) ;
}
2013-08-07 05:25:25 +00:00
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
// For javascript also minify and validate the changed file.
if ( target === 'js-enqueues' ) {
grunt . config ( [ 'uglify' , 'dynamic' , 'src' ] , src ) ;
2023-07-17 14:05:51 +00:00
grunt . config ( [ 'dynamic' , 'files' , 'src' ] , src . map ( function ( dir ) { return WORKING _DIR + dir ; } ) ) ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
// For webpack only validate the file, minification is handled by webpack itself.
if ( target === 'js-webpack' ) {
2023-07-17 14:05:51 +00:00
grunt . config ( [ 'dynamic' , 'files' , 'src' ] , src . map ( function ( dir ) { return WORKING _DIR + dir ; } ) ) ;
Once upon a midnight dreary, while I coded, weak and weary,
In many a strange and curious file of forgotten loreâ
While I pondered, blaming Nacin, my notifications suddenly awakened,
As of someone quietly DMing;âDMing me, I canât ignore.
ââTis some contributor,â I muttered, âDMing me an idea or fourâ
Only this and nothing more.â
Ah, distinctly I remember, at WordCamp US, last December;
A mad proposal nearly laid meâdown out coldâupon the floor.
Curious, I listened closely;âto a plan I agreed with, mostlyâ
A way to make our JavaScriptâJavaScript which was a choreâ
Maintainable, extendable, for the future, is what I saw.
Guten-ready for evermore.
Open here I switch to Slack, when, with many a patch and hack,
In there stepped Omar, a JavaScript developer hardcore;
Pronouncing all the changes fit; ready now to be commit;
âThereâs nothing else for us to do,â DMing me, âItâs done!â he sworeâ
âNo longer random guessing at which file need next be exploredâ
Letâs move on, weâre all aboard.â
Moved all together, grouped and managed, in folders all is packaged,
The code had all been cleaned and tidied, important parts moved to the fore,
âThough this change be useful here,â I said, âit is too large, I fear,
We couldnât manage such a patch, weâve done nothing like this beforeâ
Tell me where doth go this change, change to make our codebase soar!â
Quoth Omar, âIn WordPress Core.â
Props omarreis for shepherding this significant change.
Props adamsilverstein, aduth, atimmer, dingo_bastard, frank-klein, gziolo, herregroen, jaswrks, jeremyfelt, jipmoors, jorbin, netweb, ocean90, pento, tjnowell, and youknowriad for testing, feedback, discussion, encouragement, commiserations, etc.
I make no apologies for this commit message.
Fixes #43055.
git-svn-id: https://develop.svn.wordpress.org/trunk@43309 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-23 10:04:22 +00:00
}
// For css run the rtl task on just the changed file.
2015-09-09 02:11:23 +00:00
if ( target === 'rtl' ) {
grunt . config ( [ 'rtlcss' , 'dynamic' , 'src' ] , src ) ;
}
}
2013-08-07 05:25:25 +00:00
} ) ;
} ;