Merge branch 'trunk' into refactor/task-infrastructure

This commit is contained in:
Christopher Allford 2023-12-09 21:51:43 -08:00
commit 403e2919ee
74 changed files with 366 additions and 286 deletions

View File

@ -20,7 +20,7 @@ const runner = async () => {
return;
}
const newAssets = require( '../../build/assets.json' );
const newAssets = require( '../../../woocommerce/assets/client/blocks/assets.json' );
if ( ! newAssets ) {
return;

View File

@ -1,25 +1,11 @@
# WooCommerce Blocks <!-- omit in toc -->
[![Latest Tag](https://img.shields.io/github/tag/woocommerce/woocommerce-gutenberg-products-block.svg?style=flat&label=Latest%20Tag)](https://github.com/woocommerce/woocommerce-gutenberg-products-block/releases)
[![View](https://img.shields.io/badge/Project%20Components-brightgreen.svg?style=flat)](https://woocommerce.github.io/woocommerce-blocks/)
![JavaScript and CSS Linting](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/JavaScript%20and%20CSS%20Linting/badge.svg?branch=trunk)
![PHP Coding Standards](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/PHP%20Coding%20Standards/badge.svg?branch=trunk)
![Unit Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/E2E%20tests/badge.svg?branch=trunk)
![E2E Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/Unit%20Tests/badge.svg?branch=trunk)
This is the feature plugin for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.
Use this plugin if you want access to the bleeding edge of available blocks for WooCommerce. However, stable blocks are bundled into WooCommerce, and can be added from the "WooCommerce" section in the block inserter.
- [WCCOM product page](https://woocommerce.com/products/woocommerce-gutenberg-products-block/)
- [User documentation](https://docs.woocommerce.com/document/woocommerce-blocks/)
This is the client for WooCommerce + Gutenberg. This package serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.
## Table of Contents <!-- omit in toc -->
- [Documentation](#documentation)
- [Code Documentation](#code-documentation)
- [Installing the plugin version](#installing-the-plugin-version)
- [Installing the development version](#installing-the-development-version)
- [Getting started with block development](#getting-started-with-block-development)
- [Long-term vision](#long-term-vision)
@ -36,39 +22,12 @@ If you want to see what we're working on for future versions, or want to help ou
- [WooCommerce Blocks Handbook](./docs) - Documentation for designers and developers on how to extend or contribute to blocks, and how internal developers should handle new releases.
- [WooCommerce Blocks Storybook](https://woocommerce.github.io/woocommerce-blocks/) - Contains a list and demo of components used in the plugin.
## Installing the plugin version
We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features.
> Note: The plugin follows a policy of supporting the "L0" strategy for version support. What this means is that the plugin will require the most recent version of WordPress. It will also require the most recent version of WooCommerce core at the time of a release. You can read more about [this policy here](https://developer.woocommerce.com/?p=9998).
1.Ensure you have the latest available versions of WordPress and WooCommerce installed on your site.
2. The plugin version is available on WordPress.org. [Download the plugin version here.](https://wordpress.org/plugins/woo-gutenberg-products-block/)
3. Activate the plugin.
## Installing the development version
1. Ensure you have the latest versions of WordPress and WooCommerce installed on your site.
2. Get a copy of this plugin using the green "Clone or download" button on the right.
3. Make sure you're using Node.js v16.15. If you use a Node version management tool such as `nvm` or `n`, you can do so by running `nvm use` or `n auto`, respectively.
4. `npm install` to install the dependencies.
5. `composer install` to install core dependencies.
6. To compile the code, run any of the following commands
1. `npm run build` (production build).
2. `npm run dev` (development build).
3. `npm start` (development build + watching for changes).
7. Activate the plugin.
The source code is in the `assets/` folder, and the compiled code is stored into `build/`.
## Getting started with block development
Run through the ["Writing Your First Block Type" tutorial](https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/) for a quick course in block-building.
For deeper dive, try looking at the [core blocks code,](https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src) or see what [components are available.](https://github.com/WordPress/gutenberg/tree/master/packages/components/src)
To begin contributing to the WooCommerce Blocks plugin, see our [getting started guide](./docs/contributors/getting-started.md) and [developer handbook](./docs/README.md).
Other useful docs to explore:
- [`InnerBlocks`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md)

View File

@ -30,8 +30,8 @@ export const blocksConfig = getSetting( 'wcBlocksConfig', {
wordCountType: 'words',
} ) as WcBlocksConfig;
export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'images/';
export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'build/';
export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'assets/images/';
export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/';
export const WC_BLOCKS_PHASE = blocksConfig.buildPhase;
export const SHOP_URL = STORE_PAGES.shop?.permalink;
export const CHECKOUT_PAGE_ID = STORE_PAGES.checkout?.id;

View File

@ -84,7 +84,7 @@ const getCoreConfig = ( options = {} ) => {
filename: ( chunkData ) => {
return `${ paramCase( chunkData.chunk.name ) }.js`;
},
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
library: [ 'wc', '[name]' ],
libraryTarget: 'this',
uniqueName: 'webpackWcBlocksJsonp',
@ -117,7 +117,7 @@ const getCoreConfig = ( options = {} ) => {
...getSharedPlugins( { bundleAnalyzerReportTitle: 'Core' } ),
new ProgressBarPlugin( getProgressBarPluginConfig( 'Core' ) ),
new CreateFileWebpack( {
path: './',
path: '../woocommerce',
// file name
fileName: 'blocks.ini',
// content of the file
@ -183,7 +183,7 @@ const getMainConfig = ( options = {} ) => {
entry: getEntryConfig( 'main', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
// This is a cache busting mechanism which ensures that the script is loaded via the browser with a ?ver=hash
// string. The hash is based on the built file contents.
// @see https://github.com/webpack/webpack/issues/2329
@ -317,7 +317,7 @@ const getFrontConfig = ( options = {} ) => {
entry: getEntryConfig( 'frontend', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
// This is a cache busting mechanism which ensures that the script is loaded via the browser with a ?ver=hash
// string. The hash is based on the built file contents.
// @see https://github.com/webpack/webpack/issues/2329
@ -442,7 +442,7 @@ const getPaymentsConfig = ( options = {} ) => {
entry: getEntryConfig( 'payments', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
filename: `[name].js`,
uniqueName: 'webpackWcBlocksPaymentMethodExtensionJsonp',
},
@ -549,7 +549,7 @@ const getExtensionsConfig = ( options = {} ) => {
entry: getEntryConfig( 'extensions', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
filename: `[name].js`,
uniqueName: 'webpackWcBlocksExtensionsMethodExtensionJsonp',
},
@ -656,7 +656,7 @@ const getSiteEditorConfig = ( options = {} ) => {
entry: getEntryConfig( 'editor', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
filename: `[name].js`,
chunkLoadingGlobal: 'webpackWcBlocksExtensionsMethodExtensionJsonp',
},
@ -763,7 +763,7 @@ const getStylingConfig = ( options = {} ) => {
entry: getEntryConfig( 'styling', options.exclude || [] ),
output: {
devtoolNamespace: 'wc',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
filename: `[name]-style${ fileSuffix }.js`,
library: [ 'wc', 'blocks', '[name]' ],
libraryTarget: 'this',
@ -914,7 +914,7 @@ const getInteractivityAPIConfig = ( options = {} ) => {
},
output: {
filename: '[name].js',
path: path.resolve( __dirname, '../build/' ),
path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ),
library: [ 'wc', '__experimentalInteractivity' ],
libraryTarget: 'this',
chunkLoadingGlobal: 'webpackWcBlocksJsonp',

View File

@ -113,6 +113,7 @@
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-syntax-jsx": "7.22.5",
"@babel/preset-react": "7.23.3",
"@babel/polyfill": "7.12.1",
"@babel/preset-typescript": "7.23.2",
"@bartekbp/typescript-checkstyle": "5.0.0",
@ -144,6 +145,7 @@
"@types/jest-environment-puppeteer": "5.0.2",
"@types/jquery": "3.5.14",
"@types/lodash": "4.14.182",
"@types/prop-types": "^15.7.11",
"@types/puppeteer": "5.4.6",
"@types/react": "^17.0.71",
"@types/react-dom": "18.0.10",
@ -293,6 +295,7 @@
"html-react-parser": "3.0.4",
"postcode-validator": "3.8.15",
"preact": "^10.19.3",
"prop-types": "^15.8.1",
"react-number-format": "4.9.3",
"react-transition-group": "^4.4.5",
"reakit": "1.3.11",

View File

@ -5,7 +5,7 @@
* @package WooCommerce Blocks
*/
namespace Automattic\WooCommerce\Blocks\Tests;
namespace Automattic\WooCommerce\Tests\Blocks;
// Require composer dependencies.
require_once dirname( __DIR__ ) . '/vendor/autoload.php';

View File

@ -4,6 +4,7 @@
# Built JS
/assets/js/*
/assets/client/*
/blocks.ini
# Behat/CLI Tests
tests/cli/installer

View File

@ -54,6 +54,19 @@ pnpm --filter=@woocommerce/admin-library lint
pnpm --filter=@woocommerce/admin-library test
```
### `plugins/woocommerce-blocks`
This directory contains the client for WooCommerce + Gutenberg.
```bash
# Build the Blocks client.
pnpm run --filter=@woocommerce/block-library build
# Lint the Blocks client.
pnpm run --filter=@woocommerce/block-library lint
# Test the Blocks client.
pnpm run --filter=@woocommerce/block-library test
```
#### Helper Scripts
Here is a collection of scripts that can help when developing the React-based admin interface.

View File

@ -69,7 +69,11 @@
},
"psr-0": {
"Automattic\\WooCommerce\\Vendor\\": "lib/packages/"
}
},
"files": [
"src/StoreApi/deprecated.php",
"src/StoreApi/functions.php"
]
},
"autoload-dev": {
"psr-4": {

View File

@ -103,12 +103,12 @@ class Api {
* Get the path to a block's metadata
*
* @param string $block_name The block to get metadata for.
* @param string $path Optional. The path to the metadata file inside the 'build' folder.
* @param string $path Optional. The path to the metadata file inside the 'assets/client/blocks' folder.
*
* @return string|boolean False if metadata file is not found for the block.
*/
public function get_block_metadata_path( $block_name, $path = '' ) {
$path_to_metadata_from_plugin_root = $this->package->get_path( 'build/' . $path . $block_name . '/block.json' );
$path_to_metadata_from_plugin_root = $this->package->get_path( 'assets/client/blocks/' . $path . $block_name . '/block.json' );
if ( ! file_exists( $path_to_metadata_from_plugin_root ) ) {
return false;
}
@ -284,7 +284,7 @@ class Api {
* @param boolean $rtl Optional. Whether or not to register RTL styles.
*/
public function register_style( $handle, $relative_src, $deps = [], $media = 'all', $rtl = false ) {
$filename = str_replace( plugins_url( '/', __DIR__ ), '', $relative_src );
$filename = str_replace( plugins_url( '/', dirname( __DIR__ ) ), '', $relative_src );
$src = $this->get_asset_url( $relative_src );
$ver = $this->get_file_version( $filename );
wp_register_style( $handle, $src, $deps, $ver, $media );
@ -302,7 +302,7 @@ class Api {
* @return string The generated path.
*/
public function get_block_asset_build_path( $filename, $type = 'js' ) {
return "build/$filename.$type";
return "assets/client/blocks/$filename.$type";
}
/**

View File

@ -373,7 +373,7 @@ class AssetDataRegistry {
public function register_data_script() {
$this->api->register_script(
$this->handle,
'build/wc-settings.js',
'assets/client/blocks/wc-settings.js',
[ 'wp-api-fetch' ],
true
);

View File

@ -46,26 +46,26 @@ final class AssetsController {
* Register block scripts & styles.
*/
public function register_assets() {
$this->register_style( 'wc-blocks-packages-style', plugins_url( $this->api->get_block_asset_build_path( 'packages-style', 'css' ), __DIR__ ), [], 'all', true );
$this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks', 'css' ), __DIR__ ), [], 'all', true );
$this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), __DIR__ ), [ 'wp-edit-blocks' ], 'all', true );
$this->register_style( 'wc-blocks-packages-style', plugins_url( $this->api->get_block_asset_build_path( 'packages-style', 'css' ), dirname( __DIR__ ) ), [], 'all', true );
$this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks', 'css' ), dirname( __DIR__ ) ), [], 'all', true );
$this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), dirname( __DIR__ ) ), [ 'wp-edit-blocks' ], 'all', true );
$this->api->register_script( 'wc-blocks-middleware', 'build/wc-blocks-middleware.js', [], false );
$this->api->register_script( 'wc-blocks-data-store', 'build/wc-blocks-data.js', [ 'wc-blocks-middleware' ] );
$this->api->register_script( 'wc-blocks-middleware', 'assets/client/blocks/wc-blocks-middleware.js', [], false );
$this->api->register_script( 'wc-blocks-data-store', 'assets/client/blocks/wc-blocks-data.js', [ 'wc-blocks-middleware' ] );
$this->api->register_script( 'wc-blocks-vendors', $this->api->get_block_asset_build_path( 'wc-blocks-vendors' ), [], false );
$this->api->register_script( 'wc-blocks-registry', 'build/wc-blocks-registry.js', [], false );
$this->api->register_script( 'wc-blocks-registry', 'assets/client/blocks/wc-blocks-registry.js', [], false );
$this->api->register_script( 'wc-blocks', $this->api->get_block_asset_build_path( 'wc-blocks' ), [ 'wc-blocks-vendors' ], false );
$this->api->register_script( 'wc-blocks-shared-context', 'build/wc-blocks-shared-context.js' );
$this->api->register_script( 'wc-blocks-shared-hocs', 'build/wc-blocks-shared-hocs.js', [], false );
$this->api->register_script( 'wc-blocks-shared-context', 'assets/client/blocks/wc-blocks-shared-context.js' );
$this->api->register_script( 'wc-blocks-shared-hocs', 'assets/client/blocks/wc-blocks-shared-hocs.js', [], false );
// The price package is shared externally so has no blocks prefix.
$this->api->register_script( 'wc-price-format', 'build/price-format.js', [], false );
$this->api->register_script( 'wc-price-format', 'assets/client/blocks/price-format.js', [], false );
$this->api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [] );
$this->api->register_script( 'wc-blocks-components', 'build/blocks-components.js', [] );
$this->api->register_script( 'wc-blocks-checkout', 'assets/client/blocks/blocks-checkout.js', [] );
$this->api->register_script( 'wc-blocks-components', 'assets/client/blocks/blocks-components.js', [] );
// Register the interactivity components here for now.
$this->api->register_script( 'wc-interactivity-dropdown', 'build/wc-interactivity-dropdown.js', [] );
$this->api->register_script( 'wc-interactivity-dropdown', 'assets/client/blocks/wc-interactivity-dropdown.js', [] );
wp_add_inline_script(
'wc-blocks-middleware',
@ -83,8 +83,8 @@ final class AssetsController {
* Register and enqueue assets for exclusive usage within the Site Editor.
*/
public function register_and_enqueue_site_editor_assets() {
$this->api->register_script( 'wc-blocks-classic-template-revert-button', 'build/wc-blocks-classic-template-revert-button.js' );
$this->api->register_style( 'wc-blocks-classic-template-revert-button-style', 'build/wc-blocks-classic-template-revert-button-style.css' );
$this->api->register_script( 'wc-blocks-classic-template-revert-button', 'assets/client/blocks/wc-blocks-classic-template-revert-button.js' );
$this->api->register_style( 'wc-blocks-classic-template-revert-button-style', 'assets/client/blocks/wc-blocks-classic-template-revert-button-style.css' );
$current_screen = get_current_screen();
if ( $current_screen instanceof \WP_Screen && 'site-editor' === $current_screen->base ) {
@ -290,7 +290,7 @@ final class AssetsController {
* @param boolean $rtl Optional. Whether or not to register RTL styles.
*/
protected function register_style( $handle, $src, $deps = [], $media = 'all', $rtl = false ) {
$filename = str_replace( plugins_url( '/', __DIR__ ), '', $src );
$filename = str_replace( plugins_url( '/', dirname( __DIR__ ) ), '', $src );
$ver = self::get_file_version( $filename );
wp_register_style( $handle, $src, $deps, $ver, $media );

View File

@ -180,7 +180,7 @@ abstract class AbstractBlock {
* @return string[] $chunks list of chunks to load.
*/
protected function get_chunks_paths( $chunks_folder ) {
$build_path = \Automattic\WooCommerce\Blocks\Package::get_path() . 'build/';
$build_path = \Automattic\WooCommerce\Blocks\Package::get_path() . 'assets/client/blocks/';
$blocks = [];
if ( ! is_dir( $build_path . $chunks_folder ) ) {
return [];
@ -429,7 +429,7 @@ abstract class AbstractBlock {
'wcBlocksConfig',
[
'buildPhase' => Package::feature()->get_flag(),
'pluginUrl' => plugins_url( '/', dirname( __DIR__ ) ),
'pluginUrl' => plugins_url( '/', dirname( __DIR__, 2 ) ),
'productCount' => array_sum( (array) wp_count_posts( 'product' ) ),
'restApiRoutes' => [
'/wc/store/v1' => array_keys( $this->get_routes_from_namespace( 'wc/store/v1' ) ),

View File

@ -353,7 +353,7 @@ class Checkout extends AbstractBlock {
$declared_extensions['incompatible'],
function( $acc, $item ) use ( $all_plugins ) {
$plugin = $all_plugins[ $item ] ?? null;
$plugin_id = $plugin['TextDomain'] ?? dirname( $item );
$plugin_id = $plugin['TextDomain'] ?? dirname( $item, 2 );
$plugin_name = $plugin['Name'] ?? $plugin_id;
$acc[] = [
'id' => $plugin_id,

View File

@ -206,7 +206,7 @@ class MiniCart extends AbstractBlock {
* Prints the variable containing information about the scripts to lazy load.
*/
public function print_lazy_load_scripts() {
$script_data = $this->asset_api->get_script_data( 'build/mini-cart-component-frontend.js' );
$script_data = $this->asset_api->get_script_data( 'assets/client/blocks/mini-cart-component-frontend.js' );
$num_dependencies = is_countable( $script_data['dependencies'] ) ? count( $script_data['dependencies'] ) : 0;
$wp_scripts = wp_scripts();
@ -261,7 +261,7 @@ class MiniCart extends AbstractBlock {
);
}
foreach ( $inner_blocks_frontend_scripts as $inner_block_frontend_script ) {
$script_data = $this->asset_api->get_script_data( 'build/mini-cart-contents-block/' . $inner_block_frontend_script . '.js' );
$script_data = $this->asset_api->get_script_data( 'assets/client/blocks/mini-cart-contents-block/' . $inner_block_frontend_script . '.js' );
$this->scripts_to_lazy_load[ 'wc-block-' . $inner_block_frontend_script ] = array(
'src' => $script_data['src'],
'version' => $script_data['version'],

View File

@ -77,7 +77,6 @@ class Bootstrap {
$this->package = $container->get( Package::class );
$this->migration = $container->get( Migration::class );
if ( $this->has_core_dependencies() ) {
$this->init();
/**
* Fires when the woocommerce blocks are loaded and ready to use.
@ -93,7 +92,6 @@ class Bootstrap {
*/
do_action( 'woocommerce_blocks_loaded' );
}
}
/**
* Init the package - load the blocks library and define constants.
@ -161,39 +159,6 @@ class Bootstrap {
}
}
/**
* Check core dependencies exist.
*
* @return boolean
*/
protected function has_core_dependencies() {
$has_needed_dependencies = class_exists( 'WooCommerce', false );
if ( $has_needed_dependencies ) {
$plugin_data = \get_file_data(
$this->package->get_path( 'woocommerce-gutenberg-products-block.php' ),
[
'RequiredWCVersion' => 'WC requires at least',
]
);
if ( isset( $plugin_data['RequiredWCVersion'] ) && version_compare( \WC()->version, $plugin_data['RequiredWCVersion'], '<' ) ) {
$has_needed_dependencies = false;
add_action(
'admin_notices',
function() {
if ( should_display_compatibility_notices() ) {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'The WooCommerce Blocks plugin requires a more recent version of WooCommerce and has been deactivated. Please update to the latest version of WooCommerce.', 'woo-gutenberg-products-block' ); ?></p>
</div>
<?php
}
}
);
}
}
return $has_needed_dependencies;
}
/**
* See if files have been built or not.
*
@ -201,7 +166,7 @@ class Bootstrap {
*/
protected function is_built() {
return file_exists(
$this->package->get_path( 'build/featured-product.js' )
$this->package->get_path( 'assets/client/blocks/featured-product.js' )
);
}

View File

@ -49,9 +49,9 @@ class FeatureGating {
public function load_flag() {
if ( 0 === $this->flag ) {
$default_flag = defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ? self::FEATURE_PLUGIN_FLAG : self::CORE_FLAG;
if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) {
$allowed_flags = [ self::EXPERIMENTAL_FLAG, self::FEATURE_PLUGIN_FLAG, self::CORE_FLAG ];
$woo_options = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
$woo_options = parse_ini_file( __DIR__ . '/../../../../blocks.ini' );
$this->flag = is_array( $woo_options ) && in_array( intval( $woo_options['woocommerce_blocks_phase'] ), $allowed_flags, true ) ? $woo_options['woocommerce_blocks_phase'] : $default_flag;
} else {
$this->flag = $default_flag;
@ -64,9 +64,9 @@ class FeatureGating {
*/
public function load_environment() {
if ( 'unset' === $this->environment ) {
if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) {
$allowed_environments = [ self::PRODUCTION_ENVIRONMENT, self::DEVELOPMENT_ENVIRONMENT, self::TEST_ENVIRONMENT ];
$woo_options = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
$woo_options = parse_ini_file( __DIR__ . '/../../../../blocks.ini' );
$this->environment = is_array( $woo_options ) && in_array( $woo_options['woocommerce_blocks_env'], $allowed_environments, true ) ? $woo_options['woocommerce_blocks_env'] : self::PRODUCTION_ENVIRONMENT;
} else {
$this->environment = self::PRODUCTION_ENVIRONMENT;
@ -171,8 +171,8 @@ class FeatureGating {
* @return boolean
*/
public function is_block_templates_controller_refactor_enabled() {
if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) {
$conf = parse_ini_file( __DIR__ . '/../../../blocks.ini' );
if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) {
$conf = parse_ini_file( __DIR__ . '/../../../../blocks.ini' );
return $this->is_development_environment() && isset( $conf['use_block_templates_controller_refactor'] ) && true === (bool) $conf['use_block_templates_controller_refactor'];
}
return false;

View File

@ -41,7 +41,7 @@ class GoogleAnalytics {
* Register scripts.
*/
public function register_assets() {
$this->asset_api->register_script( 'wc-blocks-google-analytics', 'build/wc-blocks-google-analytics.js', [ 'google-tag-manager' ] );
$this->asset_api->register_script( 'wc-blocks-google-analytics', 'assets/client/blocks/wc-blocks-google-analytics.js', [ 'google-tag-manager' ] );
}
/**

View File

@ -28,7 +28,7 @@ function woocommerce_interactivity_register_runtime() {
$plugin_path = \Automattic\WooCommerce\Blocks\Package::get_path();
$plugin_url = plugin_dir_url( $plugin_path . '/index.php' );
$file = 'build/wc-interactivity.js';
$file = 'assets/client/blocks/wc-interactivity.js';
$file_path = $plugin_path . $file;
$file_url = $plugin_url . $file;

View File

@ -112,7 +112,7 @@ class Package {
$version = '11.8.0-dev';
return new NewPackage(
$version,
dirname( __DIR__ ),
dirname( __DIR__, 2 ),
new FeatureGating()
);
}

View File

@ -66,7 +66,7 @@ class PatternsHelper {
public static function get_image_url( array $images, int $index, string $default_image ): string {
$image = filter_var( $default_image, FILTER_VALIDATE_URL )
? $default_image
: plugins_url( $default_image, dirname( __DIR__ ) );
: plugins_url( $default_image, dirname( __DIR__, 2 ) );
if ( isset( $images[ $index ] ) ) {
$image = $images[ $index ];

View File

@ -11,37 +11,37 @@ class ProductUpdater {
const DUMMY_PRODUCTS = [
[
'title' => 'Vintage Typewriter',
'image' => 'images/pattern-placeholders/writing-typing-keyboard-technology-white-vintage.jpg',
'image' => 'assets/images/pattern-placeholders/writing-typing-keyboard-technology-white-vintage.jpg',
'description' => 'A hit spy novel or a love letter? Anything you type using this vintage typewriter from the 20s is bound to make a mark.',
'price' => 90,
],
[
'title' => 'Leather-Clad Leisure Chair',
'image' => 'images/pattern-placeholders/table-wood-house-chair-floor-window.jpg',
'image' => 'assets/images/pattern-placeholders/table-wood-house-chair-floor-window.jpg',
'description' => 'Sit back and relax in this comfy designer chair. High-grain leather and steel frame add luxury to your your leisure.',
'price' => 249,
],
[
'title' => 'Black and White Summer Portrait',
'image' => 'images/pattern-placeholders/white-black-black-and-white-photograph-monochrome-photography.jpg',
'image' => 'assets/images/pattern-placeholders/white-black-black-and-white-photograph-monochrome-photography.jpg',
'description' => 'This 24" x 30" high-quality print just exudes summer. Hang it on the wall and forget about the world outside.',
'price' => 115,
],
[
'title' => '3-Speed Bike',
'image' => 'images/pattern-placeholders/road-sport-vintage-wheel-retro-old.jpg',
'image' => 'assets/images/pattern-placeholders/road-sport-vintage-wheel-retro-old.jpg',
'description' => 'Zoom through the streets on this premium 3-speed bike. Manufactured and assembled in Germany in the 80s.',
'price' => 115,
],
[
'title' => 'Hi-Fi Headphones',
'image' => 'images/pattern-placeholders/man-person-music-black-and-white-white-photography.jpg',
'image' => 'assets/images/pattern-placeholders/man-person-music-black-and-white-white-photography.jpg',
'description' => 'Experience your favorite songs in a new way with these premium hi-fi headphones.',
'price' => 125,
],
[
'title' => 'Retro Glass Jug (330 ml)',
'image' => 'images/pattern-placeholders/drinkware-liquid-tableware-dishware-bottle-fluid.jpg',
'image' => 'assets/images/pattern-placeholders/drinkware-liquid-tableware-dishware-bottle-fluid.jpg',
'description' => 'Thick glass and a classic silhouette make this jug a must-have for any retro-inspired kitchen.',
'price' => 115,
],
@ -208,7 +208,7 @@ class ProductUpdater {
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
$product_image_id = media_sideload_image( plugins_url( $product_data['image'], dirname( __DIR__ ) ), $product->get_id(), $product_data['title'], 'id' );
$product_image_id = media_sideload_image( plugins_url( $product_data['image'], dirname( __DIR__, 2 ) ), $product->get_id(), $product_data['title'], 'id' );
if ( is_wp_error( $product_image_id ) ) {
return new \WP_Error( 'error_uploading_image', $product_image_id->get_error_message() );
}
@ -495,7 +495,7 @@ class ProductUpdater {
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
$product_image_id = media_sideload_image( plugins_url( self::DUMMY_PRODUCTS[ $i ]['image'], dirname( __DIR__ ) ), $product->get_id(), self::DUMMY_PRODUCTS[ $i ]['title'], 'id' );
$product_image_id = media_sideload_image( plugins_url( self::DUMMY_PRODUCTS[ $i ]['image'], dirname( __DIR__, 2 ) ), $product->get_id(), self::DUMMY_PRODUCTS[ $i ]['title'], 'id' );
$product_image_id = $product->set_image_id( $product_image_id );
$product->save();

View File

@ -56,7 +56,7 @@ final class BankTransfer extends AbstractPaymentMethodType {
public function get_payment_method_script_handles() {
$this->asset_api->register_script(
'wc-payment-method-bacs',
'build/wc-payment-method-bacs.js'
'assets/client/blocks/wc-payment-method-bacs.js'
);
return [ 'wc-payment-method-bacs' ];
}

View File

@ -79,7 +79,7 @@ final class CashOnDelivery extends AbstractPaymentMethodType {
public function get_payment_method_script_handles() {
$this->asset_api->register_script(
'wc-payment-method-cod',
'build/wc-payment-method-cod.js'
'assets/client/blocks/wc-payment-method-cod.js'
);
return [ 'wc-payment-method-cod' ];
}

View File

@ -57,7 +57,7 @@ final class Cheque extends AbstractPaymentMethodType {
public function get_payment_method_script_handles() {
$this->asset_api->register_script(
'wc-payment-method-cheque',
'build/wc-payment-method-cheque.js'
'assets/client/blocks/wc-payment-method-cheque.js'
);
return [ 'wc-payment-method-cheque' ];
}

View File

@ -57,7 +57,7 @@ final class PayPal extends AbstractPaymentMethodType {
public function get_payment_method_script_handles() {
$this->asset_api->register_script(
'wc-payment-method-paypal',
'build/wc-payment-method-paypal.js'
'assets/client/blocks/wc-payment-method-paypal.js'
);
return [ 'wc-payment-method-paypal' ];
}

View File

@ -349,7 +349,7 @@ class ShippingController {
* Load admin scripts.
*/
public function admin_scripts() {
$this->asset_api->register_script( 'wc-shipping-method-pickup-location', 'build/wc-shipping-method-pickup-location.js', [], true );
$this->asset_api->register_script( 'wc-shipping-method-pickup-location', 'assets/client/blocks/wc-shipping-method-pickup-location.js', [], true );
}
/**

View File

@ -293,7 +293,7 @@ class BlockTemplateUtils {
* @return string
*/
public static function get_templates_directory( $template_type = 'wp_template' ) {
$root_path = dirname( __DIR__, 2 ) . '/' . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR;
$root_path = dirname( __DIR__, 3 ) . '/' . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR;
$templates_directory = $root_path . self::DIRECTORY_NAMES['TEMPLATES'];
$template_parts_directory = $root_path . self::DIRECTORY_NAMES['TEMPLATE_PARTS'];

View File

@ -5,7 +5,7 @@
* @package WooCommerce\AI\Tests
*/
namespace Automattic\WooCommerce\Blocks\Tests\AI;
namespace Automattic\WooCommerce\Tests\Blocks\AI;
use Automattic\WooCommerce\Blocks\AI\Connection;
use \WP_UnitTestCase;

View File

@ -1,9 +1,9 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Assets;
namespace Automattic\WooCommerce\Tests\Blocks\Assets;
use Automattic\WooCommerce\Blocks\Assets\Api;
use Automattic\WooCommerce\Blocks\Tests\Mocks\AssetDataRegistryMock;
use Automattic\WooCommerce\Tests\Blocks\Mocks\AssetDataRegistryMock;
use Automattic\WooCommerce\Blocks\Package;
use InvalidArgumentException;

View File

@ -1,7 +1,7 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\BlockTypes;
namespace Automattic\WooCommerce\Tests\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Tests\Mocks\CartCheckoutUtilsMock;
use Automattic\WooCommerce\Tests\Blocks\Mocks\CartCheckoutUtilsMock;
/**
* Tests for the Cart block type

View File

@ -1,7 +1,7 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\BlockTypes;
namespace Automattic\WooCommerce\Tests\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Tests\Mocks\ProductCollectionMock;
use Automattic\WooCommerce\Tests\Blocks\Mocks\ProductCollectionMock;
/**
* Tests for the ProductCollection block type

View File

@ -1,7 +1,7 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\BlockTypes;
namespace Automattic\WooCommerce\Tests\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Tests\Mocks\ProductQueryMock;
use Automattic\WooCommerce\Tests\Blocks\Mocks\ProductQueryMock;
/**
* Tests for the ProductQuery block type

View File

@ -4,7 +4,7 @@
* bootstrap.
*/
namespace Automattic\WooCommerce\Blocks\Tests\Bootstrap;
namespace Automattic\WooCommerce\Tests\Blocks\Bootstrap;
use \WP_UnitTestCase;
use Automattic\WooCommerce\Blocks\Domain\Bootstrap;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Domain\Package;
namespace Automattic\WooCommerce\Tests\Blocks\Domain\Package;
use \WP_UnitTestCase;
use Automattic\WooCommerce\Blocks\Domain\Package as TestedPackage;
@ -27,8 +27,8 @@ class Package extends WP_UnitTestCase {
$this->assertEquals( __DIR__ . '/', $package->get_path() );
//test with relative
$expect = __DIR__ . '/build/test';
$this->assertEquals( $expect, $package->get_path( 'build/test') );
$expect = __DIR__ . '/assets/client/blocks/test';
$this->assertEquals( $expect, $package->get_path( 'assets/client/blocks/test') );
}
public function test_get_url() {
@ -39,8 +39,8 @@ class Package extends WP_UnitTestCase {
//test with relative
$this->assertEquals(
$test_url . 'build/test',
$package->get_url( 'build/test' )
$test_url . 'assets/client/blocks',
$package->get_url( 'assets/client/blocks' )
);
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Library;
namespace Automattic\WooCommerce\Tests\Blocks\Library;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use \WC_Order;

View File

@ -3,7 +3,7 @@
* Helper used to create fixture data for tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\Helpers;
namespace Automattic\WooCommerce\Tests\Blocks\Helpers;
/**
* FixtureData class.

View File

@ -3,7 +3,7 @@
* Ensures the helper works.
*/
namespace Automattic\WooCommerce\Blocks\Tests\Helpers;
namespace Automattic\WooCommerce\Tests\Blocks\Helpers;
require_once __DIR__ . '/ValidateSchema.php';

View File

@ -3,7 +3,7 @@
* Helper used to validate schema differences.
*/
namespace Automattic\WooCommerce\Blocks\Tests\Helpers;
namespace Automattic\WooCommerce\Tests\Blocks\Helpers;
/**
* Validate schema.

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Utils;
namespace Automattic\WooCommerce\Tests\Blocks\Utils;
use Automattic\WooCommerce\Blocks\Migration;
use Automattic\WooCommerce\Blocks\Options;

View File

@ -1,10 +1,10 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Registry;
namespace Automattic\WooCommerce\Tests\Blocks\Registry;
use Automattic\WooCommerce\Blocks\Registry\Container as ContainerTest;
use Automattic\WooCommerce\Blocks\Registry\FactoryType;
use Automattic\WooCommerce\Blocks\Tests\Mocks\MockTestDependency;
use Automattic\WooCommerce\Tests\Blocks\Mocks\MockTestDependency;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
/**

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi;
/**
* ControllerTests

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Formatters;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Formatters\CurrencyFormatter;

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Formatters;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Formatters\MoneyFormatter;

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Formatters;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Formatters\HtmlFormatter;

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Formatters;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Formatters;
use Automattic\WooCommerce\StoreApi\Formatters\MoneyFormatter;

View File

@ -3,7 +3,7 @@
* Rate Limits Tests
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi;
use Automattic\WooCommerce\StoreApi\Authentication;
use Automattic\WooCommerce\StoreApi\Utilities\RateLimits;

View File

@ -3,10 +3,10 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
/**
* Batch Controller Tests.

View File

@ -3,10 +3,10 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
use Automattic\WooCommerce\StoreApi\SessionHandler;
use Automattic\WooCommerce\StoreApi\Utilities\JsonWebToken;
use Spy_REST_Server;

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Cart Coupons Controller Tests.

View File

@ -3,10 +3,10 @@
* Cart extensions route tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
/**
* Cart Controller Tests.

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Cart Controller Tests.

View File

@ -3,7 +3,7 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
use Automattic\WooCommerce\StoreApi\Formatters;
@ -11,7 +11,7 @@ use Automattic\WooCommerce\StoreApi\Formatters\MoneyFormatter;
use Automattic\WooCommerce\StoreApi\Formatters\HtmlFormatter;
use Automattic\WooCommerce\StoreApi\Formatters\CurrencyFormatter;
use Automattic\WooCommerce\StoreApi\Schemas\V1\CheckoutSchema;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\StoreApi\Routes\V1\Checkout as CheckoutRoute;
use Automattic\WooCommerce\StoreApi\SchemaController;

View File

@ -3,7 +3,7 @@
* ControllerTestCase Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
use Automattic\WooCommerce\StoreApi\Formatters;

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Product Attributes Controller Tests.

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Product Attributes Controller Tests.

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Controller Tests.

View File

@ -3,11 +3,11 @@
* Controller Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Blocks\Tests\Helpers\ValidateSchema;
use Automattic\WooCommerce\Tests\Blocks\StoreApi\Routes\ControllerTestCase;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\ValidateSchema;
/**
* Products Controller Tests.

View File

@ -3,9 +3,9 @@
* CartController Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Utilities;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Utilities;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
use Automattic\WooCommerce\StoreApi\Utilities\CartController;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

View File

@ -3,7 +3,7 @@
* NoticeHandler Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Utilities;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Utilities;
use Automattic\WooCommerce\StoreApi\Exceptions\RouteException;
use Automattic\WooCommerce\StoreApi\Utilities\NoticeHandler;

View File

@ -3,7 +3,7 @@
* OrderController Tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Utilities;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Utilities;
use Automattic\WooCommerce\StoreApi\Exceptions\RouteException;
use Automattic\WooCommerce\StoreApi\Utilities\OrderController;

View File

@ -1,9 +1,9 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Utilities;
namespace Automattic\WooCommerce\Tests\Blocks\StoreApi\Utilities;
use Automattic\WooCommerce\StoreApi\Utilities\ProductQueryFilters;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;
use Automattic\WooCommerce\Blocks\Tests\Helpers\FixtureData;
use Automattic\WooCommerce\Tests\Blocks\Helpers\FixtureData;
class ProductQueryFiltersTest extends TestCase {
/**

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Templates;
namespace Automattic\WooCommerce\Tests\Blocks\Templates;
use \WP_UnitTestCase;
use Automattic\WooCommerce\Blocks\Templates\SingleProductTemplateCompatibility;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Templates;
namespace Automattic\WooCommerce\Tests\Blocks\Templates;
use Automattic\WooCommerce\Blocks\Templates\SingleProductTemplate;
use \WP_UnitTestCase;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Utils;
namespace Automattic\WooCommerce\Tests\Blocks\Utils;
use Automattic\WooCommerce\Blocks\Migration;
use Automattic\WooCommerce\Blocks\Options;

View File

@ -1,5 +1,5 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\BlockTypes;
namespace Automattic\WooCommerce\Tests\Blocks\BlockTypes;
use Automattic\WooCommerce\Blocks\Utils\MiniCartUtils;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Mocks;
namespace Automattic\WooCommerce\Tests\Blocks\Mocks;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;

View File

@ -1,5 +1,5 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Mocks;
namespace Automattic\WooCommerce\Tests\Blocks\Mocks;
use Automattic\WooCommerce\Blocks\Utils\CartCheckoutUtils;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Mocks;
namespace Automattic\WooCommerce\Tests\Blocks\Mocks;
class MockTestDependency {
public $dependency;

View File

@ -1,5 +1,5 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Mocks;
namespace Automattic\WooCommerce\Tests\Blocks\Mocks;
use Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection;
use Automattic\WooCommerce\Blocks\Package;

View File

@ -1,5 +1,5 @@
<?php
namespace Automattic\WooCommerce\Blocks\Tests\Mocks;
namespace Automattic\WooCommerce\Tests\Blocks\Mocks;
use Automattic\WooCommerce\Blocks\BlockTypes\ProductQuery;
use Automattic\WooCommerce\Blocks\Package;

View File

@ -20,6 +20,10 @@ if ( ! defined( 'WC_PLUGIN_FILE' ) ) {
define( 'WC_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
}
// Load core packages and the autoloader.
require __DIR__ . '/src/Autoloader.php';
require __DIR__ . '/src/Packages.php';

View File

@ -1421,7 +1421,7 @@ importers:
version: 0.2.0
'@woocommerce/e2e-utils':
specifier: ^0.1.6
version: 0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0)
version: 0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0)
'@wordpress/deprecated':
specifier: wp-6.0
version: 3.6.1
@ -2095,7 +2095,7 @@ importers:
version: 5.16.2
'@testing-library/react':
specifier: 12.1.3
version: 12.1.3(react-dom@18.2.0)(react@17.0.2)
version: 12.1.3(react-dom@17.0.2)(react@17.0.2)
'@wordpress/data':
specifier: wp-6.0
version: 6.6.1(react@17.0.2)
@ -2443,7 +2443,7 @@ importers:
version: 7.23.5
'@storybook/addon-knobs':
specifier: ^7.0.2
version: 7.0.2(@storybook/addons@7.6.4)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2)
version: 7.0.2(@storybook/addons@7.5.2)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2)
'@testing-library/react':
specifier: 12.1.3
version: 12.1.3(react-dom@16.14.0)(react@17.0.2)
@ -3869,6 +3869,9 @@ importers:
preact:
specifier: ^10.19.3
version: 10.19.3
prop-types:
specifier: ^15.8.1
version: 15.8.1
react:
specifier: ^17.0.2
version: 17.0.2
@ -3931,6 +3934,9 @@ importers:
'@babel/polyfill':
specifier: 7.12.1
version: 7.12.1
'@babel/preset-react':
specifier: 7.23.3
version: 7.23.3(@babel/core@7.23.2)
'@babel/preset-typescript':
specifier: 7.23.2
version: 7.23.2(@babel/core@7.23.2)
@ -4021,6 +4027,9 @@ importers:
'@types/lodash':
specifier: 4.14.182
version: 4.14.182
'@types/prop-types':
specifier: ^15.7.11
version: 15.7.11
'@types/puppeteer':
specifier: 5.4.6
version: 5.4.6
@ -6068,7 +6077,7 @@ packages:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.12.9
'@babel/helper-plugin-utils': 7.10.4
'@babel/helper-plugin-utils': 7.22.5
'@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.12.9)
'@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.12.9)
dev: true
@ -6494,6 +6503,15 @@ packages:
'@babel/helper-plugin-utils': 7.22.5
dev: true
/@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.12.9):
resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.12.9
'@babel/helper-plugin-utils': 7.22.5
/@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2):
resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==}
engines: {node: '>=6.9.0'}
@ -12847,7 +12865,7 @@ packages:
'@react-native-community/cli-tools': 12.1.1
chalk: 4.1.2
execa: 5.1.1
fast-xml-parser: 4.3.2
fast-xml-parser: 4.2.4
glob: 7.2.3
logkitty: 0.7.1
transitivePeerDependencies:
@ -12859,7 +12877,7 @@ packages:
'@react-native-community/cli-tools': 12.1.1
chalk: 4.1.2
execa: 5.1.1
fast-xml-parser: 4.3.2
fast-xml-parser: 4.2.4
glob: 7.2.3
ora: 5.4.1
transitivePeerDependencies:
@ -13791,7 +13809,7 @@ packages:
react-select: 3.2.0(react-dom@17.0.2)(react@17.0.2)
dev: true
/@storybook/addon-knobs@7.0.2(@storybook/addons@7.6.4)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2):
/@storybook/addon-knobs@7.0.2(@storybook/addons@7.5.2)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-PzKuscxcBPhA2jpDxJ/F+BvBRqHJ8qBki1kS1IOjmJbAfE96WFnweXZ73ImyAJnRtmtReCL6p0ZmFkrNDMDpUw==}
peerDependencies:
'@storybook/addons': ^7.0.0
@ -13807,7 +13825,7 @@ packages:
react-dom:
optional: true
dependencies:
'@storybook/addons': 7.6.4(react-dom@16.14.0)(react@17.0.2)
'@storybook/addons': 7.5.2(react-dom@16.14.0)(react@17.0.2)
'@storybook/api': 7.6.4(react-dom@16.14.0)(react@17.0.2)
'@storybook/components': 7.6.4(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2)
'@storybook/core-events': 7.6.4
@ -14096,6 +14114,19 @@ packages:
regenerator-runtime: 0.13.11
dev: true
/@storybook/addons@7.5.2(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-hRiy56zQbz72Pwa4F40srUWXKGNIriNkZ1R0j5KPd8ZqoMk1hIeW0S8E7s1vuM/MplnUE/jFJZqu6HQCvbqmGg==}
peerDependencies:
react: ^17.0.2
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@storybook/manager-api': 7.5.2(react-dom@16.14.0)(react@17.0.2)
'@storybook/preview-api': 7.5.2
'@storybook/types': 7.5.2
react: 17.0.2
react-dom: 16.14.0(react@17.0.2)
dev: true
/@storybook/addons@7.5.2(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-hRiy56zQbz72Pwa4F40srUWXKGNIriNkZ1R0j5KPd8ZqoMk1hIeW0S8E7s1vuM/MplnUE/jFJZqu6HQCvbqmGg==}
peerDependencies:
@ -14109,17 +14140,6 @@ packages:
react-dom: 17.0.2(react@17.0.2)
dev: true
/@storybook/addons@7.6.4(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-YnmLyR/ciALtzoi9HEu+Y+NJWeOVEBo9PRgQaG7zGiNDvOrLY69uU3Ej0+TZlrTqBqce42bRCrDINJfnk0Mfsg==}
dependencies:
'@storybook/manager-api': 7.6.4(react-dom@16.14.0)(react@17.0.2)
'@storybook/preview-api': 7.6.4
'@storybook/types': 7.6.4
transitivePeerDependencies:
- react
- react-dom
dev: true
/@storybook/api@6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-sj5XQXyTTxKDSqNVBlOO1h2+v8NO4EB7/7kBLOD8jpU4r4UUCLrf6G9b54j7R9/dIyi2XvrKVlp95q3yRE3zmg==}
peerDependencies:
@ -15391,6 +15411,31 @@ packages:
resolution: {integrity: sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==}
dev: true
/@storybook/manager-api@7.5.2(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-WX8GjBkITRQzhQ08WEAVjdDW8QqqIQhWOpFzXUYCxCNzt1eSALI31QQ+M1/MYymw+TOkotC/SMcn/puIAm4rdA==}
peerDependencies:
react: ^17.0.2
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@storybook/channels': 7.5.2
'@storybook/client-logger': 7.5.2
'@storybook/core-events': 7.5.2
'@storybook/csf': 0.1.2
'@storybook/global': 5.0.0
'@storybook/router': 7.5.2(react-dom@16.14.0)(react@17.0.2)
'@storybook/theming': 7.5.2(react-dom@16.14.0)(react@17.0.2)
'@storybook/types': 7.5.2
dequal: 2.0.3
lodash: 4.17.21
memoizerific: 1.11.3
react: 17.0.2
react-dom: 16.14.0(react@17.0.2)
semver: 7.5.4
store2: 2.14.2
telejson: 7.2.0
ts-dedent: 2.2.0
dev: true
/@storybook/manager-api@7.5.2(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-WX8GjBkITRQzhQ08WEAVjdDW8QqqIQhWOpFzXUYCxCNzt1eSALI31QQ+M1/MYymw+TOkotC/SMcn/puIAm4rdA==}
peerDependencies:
@ -16127,6 +16172,19 @@ packages:
regenerator-runtime: 0.13.11
dev: true
/@storybook/router@7.5.2(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-jlh48TVUlqvGkU8MnkVp9SrCHomWGtQGx1WMK94NMyOPVPTLWzM6LjIybgmHz0MTe4lpzmbiIOfSlU3pPX054w==}
peerDependencies:
react: ^17.0.2
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@storybook/client-logger': 7.5.2
memoizerific: 1.11.3
qs: 6.11.2
react: 17.0.2
react-dom: 16.14.0(react@17.0.2)
dev: true
/@storybook/router@7.5.2(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-jlh48TVUlqvGkU8MnkVp9SrCHomWGtQGx1WMK94NMyOPVPTLWzM6LjIybgmHz0MTe4lpzmbiIOfSlU3pPX054w==}
peerDependencies:
@ -16274,6 +16332,20 @@ packages:
regenerator-runtime: 0.13.11
dev: true
/@storybook/theming@7.5.2(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-DZBTcYErSYvmTYsGz7lKtiIcBe8flBw5Ojp52r3O4GcRYG4AbuUwwVvehz+O1cWaS+UW3HavrcgapERH7ZHd1A==}
peerDependencies:
react: ^17.0.2
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@17.0.2)
'@storybook/client-logger': 7.5.2
'@storybook/global': 5.0.0
memoizerific: 1.11.3
react: 17.0.2
react-dom: 16.14.0(react@17.0.2)
dev: true
/@storybook/theming@7.5.2(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-DZBTcYErSYvmTYsGz7lKtiIcBe8flBw5Ojp52r3O4GcRYG4AbuUwwVvehz+O1cWaS+UW3HavrcgapERH7ZHd1A==}
peerDependencies:
@ -17063,6 +17135,7 @@ packages:
'@types/react-dom': 18.0.10
react: 17.0.2
react-dom: 17.0.2(react@17.0.2)
<<<<<<< HEAD
dev: true
/@testing-library/react@12.1.3(react-dom@18.2.0)(react@17.0.2):
@ -17078,6 +17151,8 @@ packages:
react: 17.0.2
react-dom: 18.2.0(react@17.0.2)
dev: false
=======
>>>>>>> trunk
/@testing-library/react@12.1.5(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==}
@ -17909,6 +17984,7 @@ packages:
dependencies:
'@types/react': 17.0.71
'@types/tinycolor2': 1.4.6
'@types/wordpress__components': 23.0.10(react-dom@16.14.0)(react@17.0.2)
'@types/wordpress__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 3.4.6
'@wordpress/element': 4.4.1
@ -17924,6 +18000,7 @@ packages:
dependencies:
'@types/react': 17.0.71
'@types/tinycolor2': 1.4.6
'@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2)
'@types/wordpress__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 3.4.6
'@wordpress/element': 4.4.1
@ -17933,6 +18010,21 @@ packages:
- react
- react-dom
/@types/wordpress__components@23.0.10(react-dom@16.14.0)(react@17.0.2):
resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==}
dependencies:
'@types/react': 17.0.71
'@types/tinycolor2': 1.4.6
'@types/wordpress__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 3.4.6
'@wordpress/element': 5.22.0
downshift: 6.1.12(react@17.0.2)
re-resizable: 6.9.11(react-dom@16.14.0)(react@17.0.2)
transitivePeerDependencies:
- react
- react-dom
dev: true
/@types/wordpress__components@23.0.10(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==}
dependencies:
@ -19305,14 +19397,14 @@ packages:
transitivePeerDependencies:
- supports-color
/@woocommerce/e2e-utils@0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0):
/@woocommerce/e2e-utils@0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0):
resolution: {integrity: sha512-gWSEgFIjMqaqiiIyrpa1epIHkmBBAfk6WfRojva1f5ZmffSJCc0VbX2jQQRdFm1BuEYr8KGCCYo+q8NIjlMZ7g==}
peerDependencies:
'@woocommerce/api': ^0.2.0
dependencies:
'@woocommerce/api': 0.2.0
'@wordpress/deprecated': 2.12.3
'@wordpress/e2e-test-utils': 4.16.1(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0)
'@wordpress/e2e-test-utils': 4.16.1(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0)
config: 3.3.3
faker: 5.5.3
fishery: 1.4.0
@ -21237,7 +21329,7 @@ packages:
- react-native
dev: false
/@wordpress/e2e-test-utils@4.16.1(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0):
/@wordpress/e2e-test-utils@4.16.1(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0):
resolution: {integrity: sha512-Dpsq5m0VSvjIhro2MjACSzkOkOf1jGEryzgEMW1ikbT6YI+motspHfGtisKXgYhZJOnjV4PwuEg+9lPVnd971g==}
engines: {node: '>=8'}
peerDependencies:
@ -21250,7 +21342,7 @@ packages:
jest: 29.7.0(@types/node@16.18.68)(ts-node@10.9.2)
lodash: 4.17.21
node-fetch: 2.7.0
puppeteer: 21.6.0(typescript@5.3.3)
puppeteer: 2.1.1
transitivePeerDependencies:
- encoding
- react-native
@ -22276,7 +22368,11 @@ packages:
dependencies:
'@babel/core': 7.23.5
'@wordpress/jest-console': 6.11.0(jest@27.5.1)
<<<<<<< HEAD
babel-jest: 27.5.1(@babel/core@7.23.5)
=======
babel-jest: 27.5.1(@babel/core@7.23.2)
>>>>>>> trunk
jest: 27.5.1(ts-node@10.9.2)
transitivePeerDependencies:
- supports-color
@ -22355,6 +22451,31 @@ packages:
- supports-color
dev: true
<<<<<<< HEAD
=======
/@wordpress/jest-preset-default@8.5.2(@babel/core@7.23.2)(jest@27.5.1)(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-xlo8LNDcjuXbb1OVI9SFDm2u6JeWXu945Jo8LtPtWbRgCfgBZfQh4Y/csMbkiiIRq/Hpi5/VK2WWJJXSe5EsRQ==}
engines: {node: '>=12'}
peerDependencies:
'@babel/core': '>=7'
jest: '>=27'
react: ^17.0.2
react-dom: ^17.0.0
dependencies:
'@babel/core': 7.23.2
'@wojtekmaj/enzyme-adapter-react-17': 0.6.7(enzyme@3.11.0)(react-dom@17.0.2)(react@17.0.2)
'@wordpress/jest-console': 5.4.0(jest@27.5.1)
babel-jest: 27.5.1(@babel/core@7.23.2)
enzyme: 3.11.0
enzyme-to-json: 3.6.2(enzyme@3.11.0)
jest: 27.5.1(ts-node@10.9.2)
react: 17.0.2
react-dom: 17.0.2(react@17.0.2)
transitivePeerDependencies:
- supports-color
dev: true
>>>>>>> trunk
/@wordpress/jest-preset-default@8.5.2(@babel/core@7.23.5)(jest@27.5.1)(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-xlo8LNDcjuXbb1OVI9SFDm2u6JeWXu945Jo8LtPtWbRgCfgBZfQh4Y/csMbkiiIRq/Hpi5/VK2WWJJXSe5EsRQ==}
engines: {node: '>=12'}
@ -25491,6 +25612,7 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
<<<<<<< HEAD
'@babel/core': 7.23.5
'@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.5)
'@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.5)
@ -25518,6 +25640,35 @@ packages:
'@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.23.5)
'@babel/plugin-transform-spread': 7.23.3(@babel/core@7.23.5)
'@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.23.5)
=======
'@babel/core': 7.12.9
'@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.12.9)
'@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.12.9)
'@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.12.9)
'@babel/plugin-syntax-flow': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.12.9)
'@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.12.9)
'@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.12.9)
'@babel/plugin-transform-classes': 7.23.5(@babel/core@7.12.9)
'@babel/plugin-transform-computed-properties': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-destructuring': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-flow-strip-types': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-for-of': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-function-name': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-literals': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-member-expression-literals': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-object-super': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-property-literals': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-react-display-name': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.12.9)
'@babel/plugin-transform-shorthand-properties': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-spread': 7.23.3(@babel/core@7.12.9)
'@babel/plugin-transform-template-literals': 7.23.3(@babel/core@7.12.9)
>>>>>>> trunk
babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0
/babel-preset-jest@24.9.0(@babel/core@7.23.5):
@ -27661,6 +27812,7 @@ packages:
parse-json: 5.2.0
path-type: 4.0.0
typescript: 5.3.3
dev: true
/cp-file@7.0.0:
resolution: {integrity: sha512-0Cbj7gyvFVApzpK/uhCtQ/9kE9UnYpxMzaq5nQQC/Dh4iaj5fxp7iEFIullrYwzj8nf0qnsI1Qsx34hAeAebvw==}
@ -31552,7 +31704,11 @@ packages:
engines: {node: '>= 10.17.0'}
hasBin: true
dependencies:
<<<<<<< HEAD
debug: 4.3.4(supports-color@8.1.1)
=======
debug: 4.3.4(supports-color@9.4.0)
>>>>>>> trunk
get-stream: 5.2.0
yauzl: 2.10.0
optionalDependencies:
@ -31641,13 +31797,6 @@ packages:
hasBin: true
dependencies:
strnum: 1.0.5
dev: true
/fast-xml-parser@4.3.2:
resolution: {integrity: sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==}
hasBin: true
dependencies:
strnum: 1.0.5
/fastest-levenshtein@1.0.16:
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
@ -32084,7 +32233,6 @@ packages:
/flow-parser@0.223.3:
resolution: {integrity: sha512-9KxxDKSB22ovMpSULbOL/QAQGPN6M0YMS3PubQvB0jVc4W7QP6VhasIVic7MzKcJSh0BAVs4J6SZjoH0lDDNlg==}
engines: {node: '>=0.4.0'}
dev: true
/flush-write-stream@1.1.1:
resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==}
@ -37876,7 +38024,7 @@ packages:
'@babel/register': 7.22.15(@babel/core@7.23.5)
babel-core: 7.0.0-bridge.0(@babel/core@7.23.5)
chalk: 4.1.2
flow-parser: 0.206.0
flow-parser: 0.223.3
graceful-fs: 4.2.11
micromatch: 4.0.5
neo-async: 2.6.2
@ -42602,7 +42750,7 @@ packages:
postcss: 8.4.32
schema-utils: 3.3.0
semver: 7.5.4
webpack: 5.89.0(webpack-cli@5.1.4)
webpack: 5.89.0(webpack-cli@3.3.12)
/postcss-loader@6.2.1(postcss@8.4.32)(webpack@5.89.0):
resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==}
@ -44316,23 +44464,6 @@ packages:
- supports-color
- utf-8-validate
/puppeteer@21.6.0(typescript@5.3.3):
resolution: {integrity: sha512-u6JhSF7xaPYZ2gd3tvhYI8MwVAjLc3Cazj7UWvMV95A07/y7cIjBwYUiMU9/jm4z0FSUORriLX/RZRaiASNWPw==}
engines: {node: '>=16.13.2'}
hasBin: true
requiresBuild: true
dependencies:
'@puppeteer/browsers': 1.9.0
cosmiconfig: 8.3.6(typescript@5.3.3)
puppeteer-core: 21.6.0
transitivePeerDependencies:
- bufferutil
- encoding
- supports-color
- typescript
- utf-8-validate
dev: false
/pure-rand@6.0.4:
resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==}
@ -46588,7 +46719,7 @@ packages:
sass: 1.69.5
schema-utils: 3.3.0
semver: 7.5.4
webpack: 5.89.0(webpack-cli@5.1.4)
webpack: 5.89.0(webpack-cli@3.3.12)
/sass-loader@12.6.0(sass@1.69.5)(webpack@5.89.0):
resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==}