From 92bd375239a7623f39fbae5012e8aa483918bed4 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 25 Jan 2024 17:06:52 +0100 Subject: [PATCH] Build: Add package build shebang and sync comments (#58264) - Add shebang to bin/packages/build.js. This allows it to be called directly. It was already executable but was missing this. - Add comments to BUNDLED_PACKAGES stating that they should remain in sync and referencing the other location. --- bin/packages/build.js | 2 ++ packages/dependency-extraction-webpack-plugin/lib/util.js | 4 ++++ tools/webpack/packages.js | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/packages/build.js b/bin/packages/build.js index f4597d4f1425fa..61914bab5700a7 100755 --- a/bin/packages/build.js +++ b/bin/packages/build.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + /** * External dependencies */ diff --git a/packages/dependency-extraction-webpack-plugin/lib/util.js b/packages/dependency-extraction-webpack-plugin/lib/util.js index 3e1795ddca2470..92fdcff11612ea 100644 --- a/packages/dependency-extraction-webpack-plugin/lib/util.js +++ b/packages/dependency-extraction-webpack-plugin/lib/util.js @@ -1,4 +1,8 @@ const WORDPRESS_NAMESPACE = '@wordpress/'; + +// !! +// This list must be kept in sync with the same list in tools/webpack/packages.js +// !! const BUNDLED_PACKAGES = [ '@wordpress/dataviews', '@wordpress/icons', diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 1bbe63f064c305..0a4b8cef574464 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -24,12 +24,16 @@ const WORDPRESS_NAMESPACE = '@wordpress/'; // Experimental or other packages that should be private are bundled when used. // That way, we can iterate on these package without making them part of the public API. // See: https://github.com/WordPress/gutenberg/pull/19809 +// +// !! +// This list must be kept in sync with the matching list in packages/dependency-extraction-webpack-plugin/lib/util.js +// !! const BUNDLED_PACKAGES = [ + '@wordpress/dataviews', '@wordpress/icons', '@wordpress/interface', - '@wordpress/undo-manager', '@wordpress/sync', - '@wordpress/dataviews', + '@wordpress/undo-manager', ]; // PHP files in packages that have to be copied during build.