Skip to content

Commit 55eebcb

Browse files
dhasilvamatticbot
authored andcommitted
Forms: Add wp build to production build script (#46528)
* add wp-build to build script * include build folder in the distributed package via gitattributes * add jetpack components to e2e build script * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20965640061 Upstream-Ref: Automattic/jetpack@7da2beb
1 parent 8b9d422 commit 55eebcb

Some content is hidden

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

47 files changed

+44800
-135
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Plugin constants - Auto-generated by build process.
4+
* Do not edit this file manually.
5+
*
6+
* Returns an array of constants for use in other templates.
7+
*
8+
* @package gutenberg
9+
*/
10+
11+
return array(
12+
'version' => '7.4.0-alpha',
13+
'build_url' => plugin_dir_url( __FILE__ ),
14+
);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Main entry point for auto-generated asset registration.
4+
* Do not edit this file manually.
5+
*
6+
* @package gutenberg
7+
*/
8+
9+
// Load script module registration.
10+
$modules_file = __DIR__ . '/modules.php';
11+
if ( file_exists( $modules_file ) ) {
12+
require_once $modules_file;
13+
}
14+
15+
// Load script registration.
16+
$scripts_file = __DIR__ . '/scripts.php';
17+
if ( file_exists( $scripts_file ) ) {
18+
require_once $scripts_file;
19+
}
20+
21+
// Load style registration.
22+
$styles_file = __DIR__ . '/styles.php';
23+
if ( file_exists( $styles_file ) ) {
24+
require_once $styles_file;
25+
}
26+
27+
// Load routes registration.
28+
$routes_file = __DIR__ . '/routes.php';
29+
if ( file_exists( $routes_file ) ) {
30+
require_once $routes_file;
31+
}
32+
33+
// Load pages registration.
34+
$pages_file = __DIR__ . '/pages.php';
35+
if ( file_exists( $pages_file ) ) {
36+
require_once $pages_file;
37+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/**
3+
* Script module registration - Auto-generated by build process.
4+
* Do not edit this file manually.
5+
*
6+
* @package gutenberg
7+
*/
8+
9+
if ( ! function_exists( 'gutenberg_register_script_modules' ) ) {
10+
/**
11+
* Register all script modules.
12+
*/
13+
function gutenberg_register_script_modules() {
14+
// Load build constants
15+
$build_constants = require __DIR__ . '/constants.php';
16+
$modules_dir = __DIR__ . '/modules';
17+
$modules_file = $modules_dir . '/index.php';
18+
19+
if ( ! file_exists( $modules_file ) ) {
20+
return;
21+
}
22+
23+
$modules = require $modules_file;
24+
$base_url = $build_constants['build_url'] . 'modules/';
25+
$extension = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.js' : '.min.js';
26+
27+
foreach ( $modules as $module ) {
28+
$asset_path = $modules_dir . '/' . $module['asset'];
29+
$asset = file_exists( $asset_path ) ? require $asset_path : array();
30+
31+
wp_register_script_module(
32+
$module['id'],
33+
$base_url . $module['path'] . $extension,
34+
$asset['module_dependencies'] ?? array(),
35+
$asset['version'] ?? false,
36+
array(
37+
'fetchpriority' => 'low',
38+
'in_footer' => true,
39+
)
40+
);
41+
}
42+
}
43+
44+
add_action( 'wp_default_scripts', 'gutenberg_register_script_modules' );
45+
remove_action( 'wp_default_scripts', 'wp_default_script_modules' );
46+
}

0 commit comments

Comments
 (0)