Skip to content

Commit 1fa3c17

Browse files
committed
Build: Update Gutenberg => Core integration
1 parent eda8d9d commit 1fa3c17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3349
-4769
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ wp-tests-config.php
2020
/node_modules
2121
/npm-debug.log
2222
/build
23+
/gutenberg
2324
/tests/phpunit/build
2425
/wp-cli.local.yml
2526
/jsdoc
@@ -39,6 +40,7 @@ wp-tests-config.php
3940
/src/wp-includes/blocks/**/*.css
4041
/src/wp-includes/blocks/**/*.js
4142
/src/wp-includes/blocks/**/*.js.map
43+
/src/wp-includes/build
4244
/packagehash.txt
4345
/artifacts
4446
/setup.log

Gruntfile.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,59 @@ module.exports = function(grunt) {
14141414
grunt.task.run( 'wp-packages:refresh-deps' );
14151415
} );
14161416

1417+
// Gutenberg integration tasks.
1418+
grunt.registerTask( 'gutenberg-checkout', 'Checks out the Gutenberg repository.', function() {
1419+
const done = this.async();
1420+
grunt.util.spawn( {
1421+
cmd: 'node',
1422+
args: [ 'tools/gutenberg/checkout-gutenberg.js' ],
1423+
opts: { stdio: 'inherit' }
1424+
}, function( error, result, code ) {
1425+
done( ! error );
1426+
} );
1427+
} );
1428+
1429+
grunt.registerTask( 'gutenberg-build', 'Builds the Gutenberg repository.', function() {
1430+
const done = this.async();
1431+
grunt.util.spawn( {
1432+
cmd: 'node',
1433+
args: [ 'tools/gutenberg/build-gutenberg.js' ],
1434+
opts: { stdio: 'inherit' }
1435+
}, function( error, result, code ) {
1436+
done( ! error );
1437+
} );
1438+
} );
1439+
1440+
grunt.registerTask( 'gutenberg-copy', 'Copies Gutenberg build output to WordPress Core.', function() {
1441+
const done = this.async();
1442+
const buildDir = grunt.option( 'dev' ) ? 'src' : 'build';
1443+
grunt.util.spawn( {
1444+
cmd: 'node',
1445+
args: [ 'tools/gutenberg/copy-gutenberg-build.js', `--build-dir=${ buildDir }` ],
1446+
opts: { stdio: 'inherit' }
1447+
}, function( error, result, code ) {
1448+
done( ! error );
1449+
} );
1450+
} );
1451+
1452+
grunt.registerTask( 'gutenberg-integrate', 'Complete Gutenberg integration workflow.', [
1453+
'gutenberg-checkout',
1454+
'gutenberg-build',
1455+
'gutenberg-copy'
1456+
] );
1457+
1458+
grunt.registerTask( 'copy-vendor-scripts', 'Copies vendor scripts from node_modules to wp-includes/js/dist/vendor/.', function() {
1459+
const done = this.async();
1460+
const buildDir = grunt.option( 'dev' ) ? 'src' : 'build';
1461+
grunt.util.spawn( {
1462+
cmd: 'node',
1463+
args: [ 'tools/vendors/copy-vendors.js', `--build-dir=${ buildDir }` ],
1464+
opts: { stdio: 'inherit' }
1465+
}, function( error, result, code ) {
1466+
done( ! error );
1467+
} );
1468+
} );
1469+
14171470
grunt.renameTask( 'watch', '_watch' );
14181471

14191472
grunt.registerTask( 'watch', function() {
@@ -1853,6 +1906,8 @@ module.exports = function(grunt) {
18531906
grunt.task.run( [
18541907
'build:js',
18551908
'build:css',
1909+
'gutenberg-integrate',
1910+
'copy-vendor-scripts',
18561911
'build:certificates'
18571912
] );
18581913
} else {
@@ -1861,6 +1916,8 @@ module.exports = function(grunt) {
18611916
'build:files',
18621917
'build:js',
18631918
'build:css',
1919+
'gutenberg-integrate',
1920+
'copy-vendor-scripts',
18641921
'replace:source-maps',
18651922
'verify:build'
18661923
] );

0 commit comments

Comments
 (0)