Changeset 53311
- Timestamp:
- 04/29/2022 01:59:49 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r53140 r53311 14 14 BUILD_DIR = 'build/', 15 15 WORKING_DIR = grunt.option( 'dev' ) ? SOURCE_DIR : BUILD_DIR, 16 16 BANNER_TEXT = '/*! This file is auto-generated */', 17 17 autoprefixer = require( 'autoprefixer' ), 18 18 sass = require( 'sass' ), … … 81 81 } 82 82 }, 83 83 usebanner: { 84 84 options: { 85 85 position: 'top', … … 1217 1217 ] ); 1218 1218 1219 grunt.registerTask( 'sync-gutenberg-packages', function() { 1220 if ( grunt.option( 'update-browserlist' ) ) { 1221 // Updating the browserlist database is opt-in and up to the release lead. 1222 // 1223 // Browserlist database should be updated: 1224 // * In each release cycle up until RC1 1225 // * If Webpack throws a warning about an outdated database 1226 // 1227 // It should not be updated: 1228 // * After the RC1 1229 // * When backporting fixes to older WordPress releases. 1230 // 1231 // For more context, see: 1232 // https://github.com/WordPress/wordpress-develop/pull/2621#discussion_r859840515 1233 // https://core.trac.wordpress.org/ticket/55559 1234 grunt.task.run( 'browserslist:update' ); 1235 } 1236 1237 // Install the latest version of the packages already listed in package.json. 1238 grunt.task.run( 'wp-packages:update' ); 1239 1240 // Install any new @wordpress packages that are now required. 1241 // Update any non-@wordpress deps to the same version as required in the @wordpress packages (e.g. react 16 -> 17). 1242 grunt.task.run( 'wp-packages:refresh-deps' ); 1243 1244 // Build the files stored in the src/ directory. 1245 grunt.task.run( 'build:dev' ); 1246 } ); 1247 1219 1248 grunt.renameTask( 'watch', '_watch' ); 1220 1249 … … 1638 1667 } ); 1639 1668 1669 grunt.registerTask( 'wp-packages:update', 'Update WordPress packages', function() { 1670 const distTag = grunt.option('dist-tag') || 'latest'; 1671 grunt.log.writeln( `Updating WordPress packages (--dist-tag=${distTag})` ); 1672 spawn( 'npx', [ 'wp-scripts', 'packages-update', '--', `--dist-tag=${distTag}` ], { 1673 cwd: __dirname, 1674 stdio: 'inherit', 1675 } ); 1676 } ); 1677 1678 grunt.registerTask( 'browserslist:update', 'Update the local database of browser supports', function() { 1679 grunt.log.writeln( `Updating browsers list` ); 1680 spawn( 'npx', [ 'browserslist@latest', '--update-db' ], { 1681 cwd: __dirname, 1682 stdio: 'inherit', 1683 } ); 1684 } ); 1685 1686 grunt.registerTask( 'wp-packages:refresh-deps', 'Update version of dependencies in package.json to match the ones listed in the latest WordPress packages', function() { 1687 const distTag = grunt.option('dist-tag') || 'latest'; 1688 grunt.log.writeln( `Updating versions of dependencies listed in package.json (--dist-tag=${distTag})` ); 1689 spawn( 'node', [ 'tools/release/sync-gutenberg-packages.js', `--dist-tag=${distTag}` ], { 1690 cwd: __dirname, 1691 stdio: 'inherit', 1692 } ); 1693 } ); 1694 1640 1695 // Patch task. 1641 1696 grunt.renameTask('patch_wordpress', 'patch'); -
trunk/package.json
r53297 r53311 175 175 "test:e2e": "node ./tests/e2e/run-tests.js", 176 176 "test:visual": "node ./tests/visual-regression/run-tests.js", 177 " wp-packages-update": "wp-scripts packages-update"177 "sync-gutenberg-packages": "grunt sync-gutenberg-packages" 178 178 } 179 179 }
Note: See TracChangeset
for help on using the changeset viewer.