Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ module.exports = function(grunt) {
SOURCE_DIR + 'wp-includes/assets/script-modules-packages.php',
],

/*
* Files included in the `/gutenberg` directory that should be excluded.
*
* `tools/gutenberg/copy.js` copies every package under `gutenberg/build/scripts/`
* indiscriminately. These files are not properly excluded from the built zip file
* built for WordPress Core, so they need to be ecluded manually instead.
*/
gutenbergExcludedCoreFiles = [
'wp-includes/js/dist/sync.js',
'wp-includes/js/dist/sync.min.js',
],

// All files built by Webpack, in /src or /build.
// Webpack only builds Core-specific media files and development scripts.
// Blocks, packages, script modules, and vendors come from the Gutenberg build.
Expand Down Expand Up @@ -1727,6 +1739,20 @@ module.exports = function(grunt) {
} );
} );

/*
* Remove files that are in the `gutenberg` directory that should be included in Core.
*/
grunt.registerTask( 'gutenberg:remove-excluded-files', 'Removes Gutenberg-sourced files that should not ship in WordPress Core.', function() {
gutenbergExcludedCoreFiles.forEach( function( file ) {
var filePath = WORKING_DIR + file;

if ( fs.existsSync( filePath ) ) {
fs.unlinkSync( filePath );
grunt.log.writeln( 'Removed ' + filePath );
}
} );
} );

grunt.renameTask( 'watch', '_watch' );

grunt.registerTask( 'watch', function() {
Expand Down Expand Up @@ -2238,7 +2264,8 @@ module.exports = function(grunt) {
'build:js',
'build:css',
'build:codemirror',
'build:certificates'
'build:certificates',
'gutenberg:remove-excluded-files'
] );
} else {
grunt.task.run( [
Expand All @@ -2250,7 +2277,8 @@ module.exports = function(grunt) {
'build:css',
'build:codemirror',
'replace:source-maps',
'verify:build'
'verify:build',
'gutenberg:remove-excluded-files'
] );
}
} );
Expand Down
8 changes: 2 additions & 6 deletions src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,12 +905,8 @@
// 7.0.2
'wp-includes/collaboration',
'wp-includes/collaboration.php',
/*
* Restored in WordPress 7.1.
*
* 'wp-includes/js/dist/sync.js',
* 'wp-includes/js/dist/sync.min.js',
*/
'wp-includes/js/dist/sync.js',
'wp-includes/js/dist/sync.min.js',
// 7.1
'wp-includes/images/icon-library/accordion-heading.svg',
'wp-includes/images/icon-library/accordion-item.svg',
Expand Down
Loading