Skip to content

Commit b967c3a

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents e03ab14 + a58af85 commit b967c3a

File tree

17 files changed

+3680
-2381
lines changed

17 files changed

+3680
-2381
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Trac ticket: <!-- insert a link to the WordPress Trac ticket here -->
2323

2424
<!--
2525
You are free to use artificial intelligence (AI) tooling to contribute, but you must disclose what tooling you are using and to what extent a pull request has been authored by AI. It is your responsibility to review and take responsibility for what AI generates. See the WordPress AI Guidelines: <https://make.wordpress.org/ai/handbook/ai-guidelines/>.
26+
27+
Example disclosure:
28+
29+
AI assistance: Yes
30+
Tool(s): GitHub Copilot, ChatGPT
31+
Model(s): GPT-5.1
32+
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.
2633
-->
2734

2835
---

Gruntfile.js

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,30 @@ module.exports = function(grunt) {
4141
'wp-admin/css/colors/**/*.css',
4242
],
4343

44-
// All built js files, in /src or /build.
44+
// Built js files, in /src or /build.
4545
jsFiles = [
4646
'wp-admin/js/',
4747
'wp-includes/js/',
48-
'wp-includes/blocks/**/*.js',
49-
'wp-includes/blocks/**/*.js.map',
48+
],
49+
50+
// All files copied from the Gutenberg repository.
51+
gutenbergFiles = [
52+
'wp-includes/assets',
53+
'wp-includes/build',
54+
'wp-includes/js/dist',
55+
'wp-includes/css/dist',
56+
'wp-includes/blocks/**/*',
57+
'!wp-includes/blocks/index.php',
58+
'wp-includes/icons',
5059
],
5160

5261
// All files built by Webpack, in /src or /build.
62+
// Webpack only builds Core-specific media files and development scripts.
63+
// Blocks, packages, script modules, and vendors come from the Gutenberg build.
5364
webpackFiles = [
54-
'wp-includes/assets/*',
55-
'wp-includes/css/dist',
56-
'!wp-includes/assets/script-loader-packages.min.php',
57-
'!wp-includes/assets/script-modules-packages.min.php',
65+
'wp-includes/js/media-*.js',
66+
'wp-includes/js/media-*.min.js',
67+
'wp-includes/js/dist/development',
5868
],
5969

6070
// All workflow files that should be deleted from non-default branches.
@@ -229,13 +239,16 @@ module.exports = function(grunt) {
229239
js: jsFiles.map( function( file ) {
230240
return setFilePath( WORKING_DIR, file );
231241
} ),
242+
243+
// Clean files built by Webpack.
232244
'webpack-assets': webpackFiles.map( function( file ) {
233245
return setFilePath( WORKING_DIR, file );
234246
} ),
235-
'interactivity-assets': [
236-
WORKING_DIR + 'wp-includes/js/dist/interactivity.asset.php',
237-
WORKING_DIR + 'wp-includes/js/dist/interactivity.min.asset.php',
238-
],
247+
248+
// Clean files built by the tools/gutenberg scripts.
249+
gutenberg: gutenbergFiles.map( function( file ) {
250+
return setFilePath( WORKING_DIR, file );
251+
}),
239252
dynamic: {
240253
dot: true,
241254
expand: true,
@@ -1594,7 +1607,25 @@ module.exports = function(grunt) {
15941607
args: [ 'tools/gutenberg/download.js' ],
15951608
opts: { stdio: 'inherit' }
15961609
}, function( error ) {
1597-
done( ! error );
1610+
if ( error ) {
1611+
done( false );
1612+
return;
1613+
}
1614+
/*
1615+
* Build block editor files into the src directory every time assets
1616+
* are downloaded. This prevents failures when running from src
1617+
* without running `build:dev` after those files were removed from
1618+
* version control in https://core.trac.wordpress.org/changeset/61438.
1619+
*
1620+
* See https://core.trac.wordpress.org/ticket/64393.
1621+
*/
1622+
grunt.util.spawn( {
1623+
grunt: true,
1624+
args: [ 'build:gutenberg', '--dev' ],
1625+
opts: { stdio: 'inherit' }
1626+
}, function( buildError ) {
1627+
done( ! buildError );
1628+
} );
15981629
} );
15991630
} );
16001631

@@ -1806,7 +1837,6 @@ module.exports = function(grunt) {
18061837
'clean:webpack-assets',
18071838
'webpack:prod',
18081839
'webpack:dev',
1809-
'clean:interactivity-assets',
18101840
] );
18111841

18121842
grunt.registerTask( 'build:js', [

0 commit comments

Comments
 (0)