From a939cacf5ca34cbccb2b2e6de7f735b55c1cade5 Mon Sep 17 00:00:00 2001 From: Hayden Whiteman Date: Sat, 22 Aug 2020 22:09:14 +1200 Subject: [PATCH 01/82] Fix #27339 --- includes/class-wc-tax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-tax.php b/includes/class-wc-tax.php index 70a34ab6c0c..5f4aa1c8ba3 100644 --- a/includes/class-wc-tax.php +++ b/includes/class-wc-tax.php @@ -1189,8 +1189,10 @@ class WC_Tax { public static function get_rates_for_tax_class( $tax_class ) { global $wpdb; + $tax_class = self::format_tax_rate_class( $tax_class ); + // Get all the rates and locations. Snagging all at once should significantly cut down on the number of queries. - $rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", sanitize_title( $tax_class ) ) ); + $rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", $tax_class ) ); $locations = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rate_locations`" ); if ( ! empty( $rates ) ) { From cd579e3798b1b13fcc1cad53439b486905b9eb7c Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 28 Aug 2020 13:56:25 -0300 Subject: [PATCH 02/82] update phpcs rule --- includes/class-wc-tax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-tax.php b/includes/class-wc-tax.php index 5f4aa1c8ba3..8dd22c22dbc 100644 --- a/includes/class-wc-tax.php +++ b/includes/class-wc-tax.php @@ -403,7 +403,7 @@ class WC_Tax { $criteria_string = implode( ' AND ', $criteria ); - // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared + // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared $found_rates = $wpdb->get_results( " SELECT tax_rates.*, COUNT( locations.location_id ) as postcode_count, COUNT( locations2.location_id ) as city_count From 7ebfdbeb0e7d51a49a80b6e58851ea0c3c0aab58 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 21 Oct 2020 10:53:00 -0300 Subject: [PATCH 03/82] add support for custom container initialization script --- tests/e2e/docker/init-wp-beta.sh | 14 ++++++++++++++ tests/e2e/env/bin/docker-compose.js | 22 +++++++++++++++++----- tests/e2e/env/bin/docker-compose.sh | 2 +- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100755 tests/e2e/docker/init-wp-beta.sh diff --git a/tests/e2e/docker/init-wp-beta.sh b/tests/e2e/docker/init-wp-beta.sh new file mode 100755 index 00000000000..71907312b1b --- /dev/null +++ b/tests/e2e/docker/init-wp-beta.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "Initializing WooCommerce E2E" + +wp plugin install woocommerce --activate +wp theme install twentynineteen --activate +wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html + +# we cannot create API keys for the API, so we using basic auth, this plugin allows that. +wp plugin install https://github.com/WP-API/Basic-Auth/archive/master.zip --activate + +# update to WP beta +wp plugin install wordpress-beta-tester --activate +wp core check-update diff --git a/tests/e2e/env/bin/docker-compose.js b/tests/e2e/env/bin/docker-compose.js index c0928025b2e..a547b59db7d 100755 --- a/tests/e2e/env/bin/docker-compose.js +++ b/tests/e2e/env/bin/docker-compose.js @@ -8,18 +8,20 @@ const { getAppRoot, getAppName, getTestConfig } = require( '../utils' ); const dockerArgs = []; let command = ''; +let customInitFile = ''; program .command( 'up', 'Start and build the Docker container' ) .command( 'down', 'Stop the Docker container and remove volumes' ) .action( ( cmd, options ) => { - arg = options.args ? options.args[ 0 ] : options[ 0 ]; - if ( 'up' === arg ) { + args = options.args ? options.args : options; + if ( 'up' === args[0] ) { command = 'up'; dockerArgs.push( 'up', '--build', '-d' ); + customInitFile = args[1] ? args[1] : ''; } - if ( 'down' === arg ) { + if ( 'down' === args[0] ) { command = 'down'; dockerArgs.push( 'down', '-v' ); } @@ -32,8 +34,17 @@ const envVars = {}; if ( appPath ) { if ( 'up' === command ) { // Look for an initialization script in the dependent app. - const appInitFile = path.resolve( appPath, 'tests/e2e/docker/initialize.sh' ); - + if ( customInitFile ) { + const possibleInitFile = customInitFile; + customInitFile = path.resolve( possibleInitFile ); + if ( ! fs.existsSync( customInitFile ) ) { + customInitFile = path.resolve( appPath, possibleInitFile ); + } + if ( ! fs.existsSync( customInitFile ) ) { + customInitFile = ''; + } + } + const appInitFile = customInitFile ? customInitFile : path.resolve( appPath, 'tests/e2e/docker/initialize.sh' ); // If found, copy it into the wp-cli Docker context so // it gets picked up by the entrypoint script. if ( fs.existsSync( appInitFile ) ) { @@ -41,6 +52,7 @@ if ( appPath ) { appInitFile, path.resolve( __dirname, '../docker/wp-cli/initialize.sh' ) ); + console.log('Initializing ' + appInitFile ); } } diff --git a/tests/e2e/env/bin/docker-compose.sh b/tests/e2e/env/bin/docker-compose.sh index 7683c6b31ee..cd091eda87c 100755 --- a/tests/e2e/env/bin/docker-compose.sh +++ b/tests/e2e/env/bin/docker-compose.sh @@ -39,4 +39,4 @@ if [[ $1 ]]; then fi # # Run Docker -./bin/docker-compose.js $1 +./bin/docker-compose.js $@ From 5e2e01e7b8e9aeeadbd8ffe1b04e741d95863943 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 21 Oct 2020 13:25:23 -0300 Subject: [PATCH 04/82] add Nightly message to log, bump Travis --- tests/e2e/docker/init-wp-beta.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/docker/init-wp-beta.sh b/tests/e2e/docker/init-wp-beta.sh index 71907312b1b..fedb3144884 100755 --- a/tests/e2e/docker/init-wp-beta.sh +++ b/tests/e2e/docker/init-wp-beta.sh @@ -9,6 +9,7 @@ wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=pas # we cannot create API keys for the API, so we using basic auth, this plugin allows that. wp plugin install https://github.com/WP-API/Basic-Auth/archive/master.zip --activate -# update to WP beta +echo "Updating to WordPress Nightly" + wp plugin install wordpress-beta-tester --activate wp core check-update From 96fce186e70d3f0f911b0b8f011c1b69af419dca Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Fri, 30 Oct 2020 12:05:27 +0100 Subject: [PATCH 05/82] Use Mozart instead of a script to renamespace packages. A custom fork of the coenjacobs/mozart package is now used to change the namespace of the appropriate packages (only league/container for now) instead of the previously used prefix-vendor-namespaces script. The packages are now moved to the src/Internal/Vendor namespace instead of being modified in-place in the vendor directory. The namespaces are thus now prefixed with Automattic\WooCommerce\Internal\Vendor (previously it was just Automattic\WooCommerce\Vendor). --- .gitignore | 2 + bin/composer/mozart/composer.json | 11 + bin/composer/mozart/composer.lock | 1046 +++++++++++++++++ bin/composer/phpcs/composer.lock | 3 +- bin/composer/phpunit/composer.lock | 23 +- bin/composer/wp/composer.lock | 32 +- bin/move-vendor-packages.sh | 25 + bin/prefix-vendor-namespaces.sh | 29 - composer.json | 20 +- composer.lock | 40 +- .../AbstractServiceProvider.php | 6 +- .../DependencyManagement/Definition.php | 2 +- .../ExtendedContainer.php | 4 +- src/Internal/Vendor/README.md | 5 + .../AbstractServiceProviderTest.php | 2 +- 15 files changed, 1185 insertions(+), 65 deletions(-) create mode 100644 bin/composer/mozart/composer.json create mode 100644 bin/composer/mozart/composer.lock create mode 100755 bin/move-vendor-packages.sh delete mode 100755 bin/prefix-vendor-namespaces.sh create mode 100644 src/Internal/Vendor/README.md diff --git a/.gitignore b/.gitignore index b396e534b34..c55aa82b76e 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,8 @@ contributors.html # Packages /packages/* !/packages/README.md +/src/Internal/Vendor/* +!/src/Internal/Vendor/README.md # Screenshots for e2e tests failures /screenshots/ diff --git a/bin/composer/mozart/composer.json b/bin/composer/mozart/composer.json new file mode 100644 index 00000000000..505369afa88 --- /dev/null +++ b/bin/composer/mozart/composer.json @@ -0,0 +1,11 @@ +{ + "require-dev": { + "coenjacobs/mozart": "dev-with-improvements" + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/woocommerce/mozart" + } + ] +} diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock new file mode 100644 index 00000000000..e40c3c9f752 --- /dev/null +++ b/bin/composer/mozart/composer.lock @@ -0,0 +1,1046 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "1f8c8a5a27836dae880f7d54a6b4234a", + "packages": [], + "packages-dev": [ + { + "name": "coenjacobs/mozart", + "version": "dev-with-improvements", + "source": { + "type": "git", + "url": "https://github.com/woocommerce/mozart.git", + "reference": "14ead9f55aff907fc345fc5df464728400005a26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/woocommerce/mozart/zipball/14ead9f55aff907fc345fc5df464728400005a26", + "reference": "14ead9f55aff907fc345fc5df464728400005a26", + "shasum": "" + }, + "require": { + "league/flysystem": "^1.0", + "php": "^7.2", + "symfony/console": "^4|^5", + "symfony/finder": "^4|^5" + }, + "require-dev": { + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5" + }, + "bin": [ + "bin/mozart" + ], + "type": "library", + "autoload": { + "psr-4": { + "CoenJacobs\\Mozart\\": "src/" + } + }, + "scripts": { + "lint": [ + "composer validate", + "phpcs" + ], + "test": [ + "phpunit" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" + } + ], + "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "source": "https://github.com/woocommerce/mozart/tree/with-improvements" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/coenjacobs" + } + ], + "time": "2020-10-30T09:56:44+00:00" + }, + { + "name": "league/flysystem", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2020-08-23T07:39:11+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.36", + "phpunit/phpunit": "^8.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2020-10-18T11:50:25+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "symfony/console", + "version": "v5.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T12:01:57+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T12:01:57+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c", + "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "727d1096295d807c309fb01a851577302394c897" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897", + "reference": "727d1096295d807c309fb01a851577302394c897", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed", + "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/string", + "version": "v5.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", + "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T12:01:57+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "coenjacobs/mozart": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "1.1.0" +} diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 7b9c9dacfd7..c2860ffacc8 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -380,5 +380,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index 6c547721de9..bda843347b8 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -61,6 +61,20 @@ "constructor", "instantiate" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -109,6 +123,12 @@ "object", "object graph" ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], "time": "2020-06-29T13:22:24+00:00" }, { @@ -1488,5 +1508,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index d59017367dc..c38828204a8 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -272,27 +272,22 @@ }, { "name": "symfony/finder", - "version": "v3.4.45", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "52140652ed31cee3dabd0c481b5577201fa769b4" + "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/52140652ed31cee3dabd0c481b5577201fa769b4", - "reference": "52140652ed31cee3dabd0c481b5577201fa769b4", + "url": "https://api.github.com/repos/symfony/finder/zipball/4e1da3c110c52d868f8a9153b7de3ebc381fba78", + "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -317,7 +312,21 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2020-09-02T16:06:40+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" }, { "name": "wp-cli/i18n-command", @@ -546,5 +555,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/bin/move-vendor-packages.sh b/bin/move-vendor-packages.sh new file mode 100755 index 00000000000..813971a9925 --- /dev/null +++ b/bin/move-vendor-packages.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Output colorized strings +# +# Color codes: +# 0 - black +# 1 - red +# 2 - green +# 3 - yellow +# 4 - blue +# 5 - magenta +# 6 - cian +# 7 - white +output() { + echo "$(tput setaf "$1")$2$(tput sgr0)" +} + +output 6 "Moving the appropriate vendor packages to Automattic\WooCommerce\Internal\Vendor" + +# Delete the entire contents of src/Internal/Vendor, except README.md +find src/Internal/Vendor/* ! -name README.md -prune -exec rm -rf {} + + +# Move the appropriate vendor packages to src/Internal/Vendor +# (see extra/mozart for configuration) +./vendor/bin/mozart compose diff --git a/bin/prefix-vendor-namespaces.sh b/bin/prefix-vendor-namespaces.sh deleted file mode 100755 index 393b6974c8d..00000000000 --- a/bin/prefix-vendor-namespaces.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# Output colorized strings -# -# Color codes: -# 0 - black -# 1 - red -# 2 - green -# 3 - yellow -# 4 - blue -# 5 - magenta -# 6 - cian -# 7 - white -output() { - echo "$(tput setaf "$1")$2$(tput sgr0)" -} - -output 6 "Prefixing the appropriate vendor namespaces with Automattic\WooCommerce\Vendor" - -# Replace "League\Container" in "use" and "namespace" with "Automattic\WooCommerce\Vendor\League\Container". -REGEX='s/^[[:space:]]*(use|namespace)[[:space:]]*(League\\Container)/\1 Automattic\\WooCommerce\\Vendor\\\2/g' - -find ./vendor/league/container -iname '*.php' -exec sed -i'.bak' -E -e "$REGEX" {} \; -find ./vendor/league/container -name "*.php.bak" -type f -delete - -# Replace too in the composer.json file for the package. -sed -i'.bak' -E -e "s/\"(League\\\\\\\Container)/\"Automattic\\\\\\\WooCommerce\\\\\\\Vendor\\\\\\\\\1/g" vendor/league/container/composer.json -rm -f vendor/league/container/composer.json.bak - diff --git a/composer.json b/composer.json index 291d1bee5e8..f227463326e 100644 --- a/composer.json +++ b/composer.json @@ -42,8 +42,7 @@ "includes/rest-api" ], "psr-4": { - "Automattic\\WooCommerce\\": "src/", - "Automattic\\WooCommerce\\Vendor\\League\\Container\\": "vendor/league/container/" + "Automattic\\WooCommerce\\": "src/" } }, "autoload-dev": { @@ -58,12 +57,12 @@ "scripts": { "post-install-cmd": [ "@composer bin all install --ansi", - "sh ./bin/prefix-vendor-namespaces.sh", + "sh ./bin/move-vendor-packages.sh", "sh ./bin/package-update.sh" ], "post-update-cmd": [ "@composer bin all update --ansi", - "sh ./bin/prefix-vendor-namespaces.sh", + "sh ./bin/move-vendor-packages.sh", "sh ./bin/package-update.sh" ], "test": [ @@ -104,6 +103,19 @@ }, "bamarni-bin": { "target-directory": "bin/composer" + }, + "mozart": { + "dep_namespace": "Automattic\\WooCommerce\\Internal\\Vendor\\", + "dep_directory": "/src/Internal/Vendor/", + "packages": [ + "league/container" + ], + "excluded_packages": [ + "psr/container" + ], + "classmap_directory": "/classmaps", + "classmap_prefix": "WOO_", + "delete_vendor_directories": true } } } diff --git a/composer.lock b/composer.lock index 5e55ec3f1f6..bade869e1e6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ed84c4d91482a5c508caaf50e843de58", + "content-hash": "7657565a2afcf2a92f62b59f56a06813", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -259,6 +259,12 @@ "provider", "service" ], + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], "time": "2020-09-28T13:38:44+00:00" }, { @@ -446,27 +452,22 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.45", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518" + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9ccf6e78077a3fc1596e6c7b5958008965a11518", - "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" @@ -495,7 +496,21 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2020-03-16T08:31:04+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" }, { "name": "woocommerce/action-scheduler", @@ -686,5 +701,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/src/Internal/DependencyManagement/AbstractServiceProvider.php b/src/Internal/DependencyManagement/AbstractServiceProvider.php index bd1409ebda3..128ceaa9e79 100644 --- a/src/Internal/DependencyManagement/AbstractServiceProvider.php +++ b/src/Internal/DependencyManagement/AbstractServiceProvider.php @@ -5,8 +5,8 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; -use Automattic\WooCommerce\Vendor\League\Container\Argument\RawArgument; -use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Argument\RawArgument; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; /** * Base class for the service providers used to register classes in the container. @@ -18,7 +18,7 @@ use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterfac * - The `share_with_auto_arguments` method, sibling of the above. * - Convenience `add` and `share` methods that are just proxies for the same methods in `$this->getContainer()`. */ -abstract class AbstractServiceProvider extends \Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\AbstractServiceProvider { +abstract class AbstractServiceProvider extends \Automattic\WooCommerce\Internal\Vendor\League\Container\ServiceProvider\AbstractServiceProvider { /** * Register a class in the container and use reflection to guess the injection method arguments. diff --git a/src/Internal/DependencyManagement/Definition.php b/src/Internal/DependencyManagement/Definition.php index 5ed07283749..b4248fd49c1 100644 --- a/src/Internal/DependencyManagement/Definition.php +++ b/src/Internal/DependencyManagement/Definition.php @@ -5,7 +5,7 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; -use Automattic\WooCommerce\Vendor\League\Container\Definition\Definition as BaseDefinition; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\Definition as BaseDefinition; /** * An extension of the definition class that replaces constructor injection with method injection. diff --git a/src/Internal/DependencyManagement/ExtendedContainer.php b/src/Internal/DependencyManagement/ExtendedContainer.php index a4e084cf76a..59bd25dee87 100644 --- a/src/Internal/DependencyManagement/ExtendedContainer.php +++ b/src/Internal/DependencyManagement/ExtendedContainer.php @@ -6,8 +6,8 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; use Automattic\WooCommerce\Utilities\StringUtil; -use Automattic\WooCommerce\Vendor\League\Container\Container as BaseContainer; -use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Container as BaseContainer; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; /** * This class extends the original League's Container object by adding some functionality diff --git a/src/Internal/Vendor/README.md b/src/Internal/Vendor/README.md new file mode 100644 index 00000000000..baf4742594c --- /dev/null +++ b/src/Internal/Vendor/README.md @@ -0,0 +1,5 @@ +## Vendor files directory + +The contents of this directory are automatically generated by moving some of the packages in the `vendor` directory and prefixing the namespace of their classes with `Automattic\WooCommerce\Internal\Vendor`, right after `composer install/update` finishes. This is done to prevent conflicts with plugins using the same packages. + +**Do no** make manual changes in the files here. Such changes will be lost the next time `composer install/update` runs. diff --git a/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php b/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php index beaa70dcef8..acc6ba81b83 100644 --- a/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php +++ b/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php @@ -15,7 +15,7 @@ use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\Cl use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithPrivateInjectionMethod; use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithScalarInjectionMethodArgument; use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DependencyClass; -use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; /** * Tests for AbstractServiceProvider. From cc71d70cce3e16d70f609a59c9a4ed3a51b7a0b0 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 30 Oct 2020 10:49:27 -0300 Subject: [PATCH 06/82] Change git cloning depth to 1 to make the Travis builds faster By default, Travis uses a depth of 50 when cloning git repositories. This commit changes the depth to 1. This will make each Travis build run slightly faster. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1b804ddae43..6b2351be3e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,3 +92,8 @@ branches: before_install: - composer self-update --1 + +# Git clone depth +# By default Travis CI clones repositories to a depth of 50 commits. Using a depth of 1 makes this step a bit faster. +git: + depth: 1 From 8bb0f196e622c78e1fec55b22ceb2d903859bf60 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Thu, 5 Nov 2020 17:19:14 +0100 Subject: [PATCH 07/82] Change the strategy for moving packages Since the Mozart package requires PHP 7.2, and we need to support 7.0 and 7.1, the moving step has been removed from the composer install stage. Instead, now it has to be triggered manually via `composer run move-vendor-namespaces`, and the moved package must be added to source control. See the updated src/Internal/Vendor/REAMDE.md for details. --- .gitignore | 2 - bin/composer/phpunit/composer.lock | 14 +++ bin/move-vendor-packages.sh | 11 ++- composer.json | 11 ++- composer.lock | 146 ++++++++++++++--------------- package-lock.json | 4 +- src/Internal/Vendor/README.md | 42 ++++++++- tests/e2e/env/package-lock.json | 8 +- 8 files changed, 150 insertions(+), 88 deletions(-) diff --git a/.gitignore b/.gitignore index c55aa82b76e..b396e534b34 100644 --- a/.gitignore +++ b/.gitignore @@ -66,8 +66,6 @@ contributors.html # Packages /packages/* !/packages/README.md -/src/Internal/Vendor/* -!/src/Internal/Vendor/README.md # Screenshots for e2e tests failures /screenshots/ diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index bda843347b8..85fb5cd406b 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -1407,6 +1407,20 @@ "polyfill", "portable" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-10-23T14:02:19+00:00" }, { diff --git a/bin/move-vendor-packages.sh b/bin/move-vendor-packages.sh index 813971a9925..40f06127800 100755 --- a/bin/move-vendor-packages.sh +++ b/bin/move-vendor-packages.sh @@ -15,6 +15,11 @@ output() { echo "$(tput setaf "$1")$2$(tput sgr0)" } +if [ -z "$(php -r "echo version_compare(PHP_VERSION,'7.2','>=');")" ]; then + output 1 "PHP 7.2 or newer is required to run Mozart, the current PHP version is $(php -r 'echo PHP_VERSION;')" + exit 1 +fi + output 6 "Moving the appropriate vendor packages to Automattic\WooCommerce\Internal\Vendor" # Delete the entire contents of src/Internal/Vendor, except README.md @@ -22,4 +27,8 @@ find src/Internal/Vendor/* ! -name README.md -prune -exec rm -rf {} + # Move the appropriate vendor packages to src/Internal/Vendor # (see extra/mozart for configuration) -./vendor/bin/mozart compose +./vendor/bin/mozart compose || exit "$?" + +output 6 "Updating autoload files" + +composer dump-autoload diff --git a/composer.json b/composer.json index f227463326e..3b73a138a23 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,11 @@ "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", "woocommerce/woocommerce-admin": "1.6.3", - "woocommerce/woocommerce-blocks": "3.6.0", - "league/container": "3.3.3" + "woocommerce/woocommerce-blocks": "3.6.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4" + "bamarni/composer-bin-plugin": "^1.4", + "league/container": "3.3.3" }, "config": { "platform": { @@ -57,12 +57,10 @@ "scripts": { "post-install-cmd": [ "@composer bin all install --ansi", - "sh ./bin/move-vendor-packages.sh", "sh ./bin/package-update.sh" ], "post-update-cmd": [ "@composer bin all update --ansi", - "sh ./bin/move-vendor-packages.sh", "sh ./bin/package-update.sh" ], "test": [ @@ -85,6 +83,9 @@ ], "bin": [ "echo 'bin not installed'" + ], + "move-vendor-packages": [ + "sh ./bin/move-vendor-packages.sh" ] }, "extra": { diff --git a/composer.lock b/composer.lock index bade869e1e6..c977ff30145 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7657565a2afcf2a92f62b59f56a06813", + "content-hash": "f2b2db27127990ff25db309d00a0dbcb", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -195,78 +195,6 @@ ], "time": "2019-08-12T15:00:31+00:00" }, - { - "name": "league/container", - "version": "3.3.3", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/container.git", - "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05", - "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/container": "^1.0" - }, - "provide": { - "psr/container-implementation": "^1.0" - }, - "replace": { - "orno/di": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Container\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Phil Bennett", - "email": "philipobenito@gmail.com", - "homepage": "http://www.philipobenito.com", - "role": "Developer" - } - ], - "description": "A fast and intuitive dependency injection container.", - "homepage": "https://github.com/thephpleague/container", - "keywords": [ - "container", - "dependency", - "di", - "injection", - "league", - "provider", - "service" - ], - "funding": [ - { - "url": "https://github.com/philipobenito", - "type": "github" - } - ], - "time": "2020-09-28T13:38:44+00:00" - }, { "name": "maxmind-db/reader", "version": "v1.6.0", @@ -688,6 +616,78 @@ "tool" ], "time": "2020-05-03T08:27:20+00:00" + }, + { + "name": "league/container", + "version": "3.3.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05", + "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2020-09-28T13:38:44+00:00" } ], "aliases": [], diff --git a/package-lock.json b/package-lock.json index dfb8806bb5e..3fe35f81b2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "woocommerce", - "version": "4.7.0", + "version": "4.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -21901,7 +21901,7 @@ "version": "file:tests/e2e/utils", "dev": true, "requires": { - "@woocommerce/api": "file:tests/e2e/api", + "@woocommerce/api": "0.1.0", "@wordpress/e2e-test-utils": "4.6.0", "faker": "^5.1.0", "fishery": "^1.0.1" diff --git a/src/Internal/Vendor/README.md b/src/Internal/Vendor/README.md index baf4742594c..107994346a0 100644 --- a/src/Internal/Vendor/README.md +++ b/src/Internal/Vendor/README.md @@ -2,4 +2,44 @@ The contents of this directory are automatically generated by moving some of the packages in the `vendor` directory and prefixing the namespace of their classes with `Automattic\WooCommerce\Internal\Vendor`, right after `composer install/update` finishes. This is done to prevent conflicts with plugins using the same packages. -**Do no** make manual changes in the files here. Such changes will be lost the next time `composer install/update` runs. +**Do no** make manual changes in the files here. Such changes will be lost the next time the contents are regenerated. + +### Registering packages to be moved + +If you want to register a vendor package for being moved to the `Automattic\WooCommerce\Internal\Vendor` namespace in order to avoid possible namespace conflicts, follow these steps: + +1. Add the package to the `require-dev` section in `composer.json`. If the package was already listed in `require`, remove it. + +2. Add the package to the `extra/mozart/packages` section in `composer.json` too, note that this time you add only the package slug (not the version). + +3. Run `composer update`. + +4. Run `composer run move-vendor-packages`. + +5. Notice that a new folder `VendorName/PackageName` has been added to `src/Internal/Vendor`. Add it to source control. + +6. All the namespaces in the moved code will have been prefixed with `Automattic\WooCommerce\Internal\Vendor`, so if you already had code that made use of the package, you'll need to adjust it accordingly. + +The `composer run move-vendor-packages` command uses the [coenjacobs/mozart](https://github.com/coenjacobs/mozart) package, which requires PHP 7.2 or newer. + +### Updating packages + +If you want to update any of the moved packages to a new version, repeat steps 3 to 5 above. + +### Preventing a dependency from being moved + +If you want to prevent a package dependency from being moved and thus re-namespaced (for example, we use a moved `league/container` package but it has a dependency on `psr/container` which we don't want to be moved) you need to follow these additional steps after 2 above: + +2.1. Add the dependency to the `require` section in `composer.json`. Yes, this time it's `require`, not `require-dev`. + +2.2. Add the dependency to the `extra/mozart/excluded-packages` section in `composer.json` too (again, the slug only). + +### Why adding the packages to be moved to require-dev? + +Once a package has been moved it's no longer needed in the `vendor` directory, so we don't want it to be there when we build WooCommerce into a zip file (we want that zip file to be as small as possible). + +Fortunately, the `npm run build` command executes `composer install --no-dev` before generating the zip file. Therefore, by adding the package to `require-dev` we make sure that the package will not be present in the `vendor` directory in the generated zip. + +The package will still be in `vendor` when you run `composer update/install` in your development environment, but you are free to just ignore it. Note that `composer run move-vendor-packages` will effectively remove the package from `vendor`, but that's not a command you will normally need to run. + + diff --git a/tests/e2e/env/package-lock.json b/tests/e2e/env/package-lock.json index 4e9c9bb96da..2ffbfffb2dc 100644 --- a/tests/e2e/env/package-lock.json +++ b/tests/e2e/env/package-lock.json @@ -1,11 +1,11 @@ { "name": "@woocommerce/e2e-environment", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { "@automattic/puppeteer-utils": { - "version": "github:Automattic/puppeteer-utils#0f3ec50fc22d7bd2a4bd69fc172e8a66d958ef2d", + "version": "github:Automattic/puppeteer-utils#0f3ec50", "from": "github:Automattic/puppeteer-utils#0f3ec50", "requires": { "@babel/cli": "^7.8.3", @@ -2814,7 +2814,7 @@ } }, "prettier": { - "version": "npm:wp-prettier@1.19.1", + "version": "npm:prettier@1.19.1", "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-1.19.1.tgz", "integrity": "sha512-mqAC2r1NDmRjG+z3KCJ/i61tycKlmADIjxnDhQab+KBxSAGbF/W7/zwB2guy/ypIeKrrftNsIYkNZZQKf3vJcg==", "dev": true @@ -9820,7 +9820,7 @@ "dev": true }, "prettier": { - "version": "npm:wp-prettier@1.19.1", + "version": "npm:prettier@1.19.1", "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-1.19.1.tgz", "integrity": "sha512-mqAC2r1NDmRjG+z3KCJ/i61tycKlmADIjxnDhQab+KBxSAGbF/W7/zwB2guy/ypIeKrrftNsIYkNZZQKf3vJcg==" }, From 5509e2185c5473b2ef866d41534ba170e8c2e1d8 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Thu, 5 Nov 2020 17:21:38 +0100 Subject: [PATCH 08/82] Add src/Internal/Vendor/League to source control. --- .../Argument/ArgumentResolverInterface.php | 28 ++ .../Argument/ArgumentResolverTrait.php | 120 ++++++++ .../League/Container/Argument/ClassName.php | 29 ++ .../Container/Argument/ClassNameInterface.php | 13 + .../Argument/ClassNameWithOptionalValue.php | 39 +++ .../League/Container/Argument/RawArgument.php | 29 ++ .../Argument/RawArgumentInterface.php | 13 + .../Vendor/League/Container/Container.php | 248 ++++++++++++++++ .../Container/ContainerAwareInterface.php | 40 +++ .../League/Container/ContainerAwareTrait.php | 76 +++++ .../Container/Definition/Definition.php | 274 ++++++++++++++++++ .../Definition/DefinitionAggregate.php | 124 ++++++++ .../DefinitionAggregateInterface.php | 67 +++++ .../Definition/DefinitionInterface.php | 120 ++++++++ .../Exception/ContainerException.php | 10 + .../Container/Exception/NotFoundException.php | 10 + .../League/Container/Inflector/Inflector.php | 123 ++++++++ .../Inflector/InflectorAggregate.php | 58 ++++ .../Inflector/InflectorAggregateInterface.php | 27 ++ .../Inflector/InflectorInterface.php | 60 ++++ .../League/Container/ReflectionContainer.php | 125 ++++++++ .../AbstractServiceProvider.php | 46 +++ .../BootableServiceProviderInterface.php | 14 + .../ServiceProviderAggregate.php | 106 +++++++ .../ServiceProviderAggregateInterface.php | 36 +++ .../ServiceProviderInterface.php | 46 +++ 26 files changed, 1881 insertions(+) create mode 100644 src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php create mode 100644 src/Internal/Vendor/League/Container/Argument/ArgumentResolverTrait.php create mode 100644 src/Internal/Vendor/League/Container/Argument/ClassName.php create mode 100644 src/Internal/Vendor/League/Container/Argument/ClassNameInterface.php create mode 100644 src/Internal/Vendor/League/Container/Argument/ClassNameWithOptionalValue.php create mode 100644 src/Internal/Vendor/League/Container/Argument/RawArgument.php create mode 100644 src/Internal/Vendor/League/Container/Argument/RawArgumentInterface.php create mode 100644 src/Internal/Vendor/League/Container/Container.php create mode 100644 src/Internal/Vendor/League/Container/ContainerAwareInterface.php create mode 100644 src/Internal/Vendor/League/Container/ContainerAwareTrait.php create mode 100644 src/Internal/Vendor/League/Container/Definition/Definition.php create mode 100644 src/Internal/Vendor/League/Container/Definition/DefinitionAggregate.php create mode 100644 src/Internal/Vendor/League/Container/Definition/DefinitionAggregateInterface.php create mode 100644 src/Internal/Vendor/League/Container/Definition/DefinitionInterface.php create mode 100644 src/Internal/Vendor/League/Container/Exception/ContainerException.php create mode 100644 src/Internal/Vendor/League/Container/Exception/NotFoundException.php create mode 100644 src/Internal/Vendor/League/Container/Inflector/Inflector.php create mode 100644 src/Internal/Vendor/League/Container/Inflector/InflectorAggregate.php create mode 100644 src/Internal/Vendor/League/Container/Inflector/InflectorAggregateInterface.php create mode 100644 src/Internal/Vendor/League/Container/Inflector/InflectorInterface.php create mode 100644 src/Internal/Vendor/League/Container/ReflectionContainer.php create mode 100644 src/Internal/Vendor/League/Container/ServiceProvider/AbstractServiceProvider.php create mode 100644 src/Internal/Vendor/League/Container/ServiceProvider/BootableServiceProviderInterface.php create mode 100644 src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderAggregate.php create mode 100644 src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php create mode 100644 src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderInterface.php diff --git a/src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php b/src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php new file mode 100644 index 00000000000..82744c31f91 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php @@ -0,0 +1,28 @@ +getValue(); + } elseif ($argument instanceof ClassNameInterface) { + $id = $argument->getClassName(); + } elseif (!is_string($argument)) { + return $argument; + } else { + $justStringValue = true; + $id = $argument; + } + + $container = null; + + try { + $container = $this->getLeagueContainer(); + } catch (ContainerException $e) { + if ($this instanceof ReflectionContainer) { + $container = $this; + } + } + + if ($container !== null) { + try { + return $container->get($id); + } catch (NotFoundException $exception) { + if ($argument instanceof ClassNameWithOptionalValue) { + return $argument->getOptionalValue(); + } + + if ($justStringValue) { + return $id; + } + + throw $exception; + } + } + + if ($argument instanceof ClassNameWithOptionalValue) { + return $argument->getOptionalValue(); + } + + // Just a string value. + return $id; + }, $arguments); + } + + /** + * {@inheritdoc} + */ + public function reflectArguments(ReflectionFunctionAbstract $method, array $args = []) : array + { + $arguments = array_map(function (ReflectionParameter $param) use ($method, $args) { + $name = $param->getName(); + $type = $param->getType(); + + if (array_key_exists($name, $args)) { + return new RawArgument($args[$name]); + } + + if ($type) { + if (PHP_VERSION_ID >= 70200) { + $typeName = $type->getName(); + } else { + $typeName = (string) $type; + } + + $typeName = ltrim($typeName, '?'); + + if ($param->isDefaultValueAvailable()) { + return new ClassNameWithOptionalValue($typeName, $param->getDefaultValue()); + } + + return new ClassName($typeName); + } + + if ($param->isDefaultValueAvailable()) { + return new RawArgument($param->getDefaultValue()); + } + + throw new NotFoundException(sprintf( + 'Unable to resolve a value for parameter (%s) in the function/method (%s)', + $name, + $method->getName() + )); + }, $method->getParameters()); + + return $this->resolveArguments($arguments); + } + + /** + * @return ContainerInterface + */ + abstract public function getContainer() : ContainerInterface; + + /** + * @return Container + */ + abstract public function getLeagueContainer() : Container; +} diff --git a/src/Internal/Vendor/League/Container/Argument/ClassName.php b/src/Internal/Vendor/League/Container/Argument/ClassName.php new file mode 100644 index 00000000000..679edb35a6f --- /dev/null +++ b/src/Internal/Vendor/League/Container/Argument/ClassName.php @@ -0,0 +1,29 @@ +value = $value; + } + + /** + * {@inheritdoc} + */ + public function getClassName() : string + { + return $this->value; + } +} diff --git a/src/Internal/Vendor/League/Container/Argument/ClassNameInterface.php b/src/Internal/Vendor/League/Container/Argument/ClassNameInterface.php new file mode 100644 index 00000000000..82d3489dafb --- /dev/null +++ b/src/Internal/Vendor/League/Container/Argument/ClassNameInterface.php @@ -0,0 +1,13 @@ +className = $className; + $this->optionalValue = $optionalValue; + } + + /** + * @inheritDoc + */ + public function getClassName(): string + { + return $this->className; + } + + public function getOptionalValue() + { + return $this->optionalValue; + } +} diff --git a/src/Internal/Vendor/League/Container/Argument/RawArgument.php b/src/Internal/Vendor/League/Container/Argument/RawArgument.php new file mode 100644 index 00000000000..d5d97e5b071 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Argument/RawArgument.php @@ -0,0 +1,29 @@ +value = $value; + } + + /** + * {@inheritdoc} + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Internal/Vendor/League/Container/Argument/RawArgumentInterface.php b/src/Internal/Vendor/League/Container/Argument/RawArgumentInterface.php new file mode 100644 index 00000000000..f9d8c844592 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Argument/RawArgumentInterface.php @@ -0,0 +1,13 @@ +definitions = $definitions ?? new DefinitionAggregate; + $this->providers = $providers ?? new ServiceProviderAggregate; + $this->inflectors = $inflectors ?? new InflectorAggregate; + + if ($this->definitions instanceof ContainerAwareInterface) { + $this->definitions->setLeagueContainer($this); + } + + if ($this->providers instanceof ContainerAwareInterface) { + $this->providers->setLeagueContainer($this); + } + + if ($this->inflectors instanceof ContainerAwareInterface) { + $this->inflectors->setLeagueContainer($this); + } + } + + /** + * Add an item to the container. + * + * @param string $id + * @param mixed $concrete + * @param boolean $shared + * + * @return DefinitionInterface + */ + public function add(string $id, $concrete = null, bool $shared = null) : DefinitionInterface + { + $concrete = $concrete ?? $id; + $shared = $shared ?? $this->defaultToShared; + + return $this->definitions->add($id, $concrete, $shared); + } + + /** + * Proxy to add with shared as true. + * + * @param string $id + * @param mixed $concrete + * + * @return DefinitionInterface + */ + public function share(string $id, $concrete = null) : DefinitionInterface + { + return $this->add($id, $concrete, true); + } + + /** + * Whether the container should default to defining shared definitions. + * + * @param boolean $shared + * + * @return self + */ + public function defaultToShared(bool $shared = true) : ContainerInterface + { + $this->defaultToShared = $shared; + + return $this; + } + + /** + * Get a definition to extend. + * + * @param string $id [description] + * + * @return DefinitionInterface + */ + public function extend(string $id) : DefinitionInterface + { + if ($this->providers->provides($id)) { + $this->providers->register($id); + } + + if ($this->definitions->has($id)) { + return $this->definitions->getDefinition($id); + } + + throw new NotFoundException( + sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $id) + ); + } + + /** + * Add a service provider. + * + * @param ServiceProviderInterface|string $provider + * + * @return self + */ + public function addServiceProvider($provider) : self + { + $this->providers->add($provider); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function get($id, bool $new = false) + { + if ($this->definitions->has($id)) { + $resolved = $this->definitions->resolve($id, $new); + return $this->inflectors->inflect($resolved); + } + + if ($this->definitions->hasTag($id)) { + $arrayOf = $this->definitions->resolveTagged($id, $new); + + array_walk($arrayOf, function (&$resolved) { + $resolved = $this->inflectors->inflect($resolved); + }); + + return $arrayOf; + } + + if ($this->providers->provides($id)) { + $this->providers->register($id); + + if (!$this->definitions->has($id) && !$this->definitions->hasTag($id)) { + throw new ContainerException(sprintf('Service provider lied about providing (%s) service', $id)); + } + + return $this->get($id, $new); + } + + foreach ($this->delegates as $delegate) { + if ($delegate->has($id)) { + $resolved = $delegate->get($id); + return $this->inflectors->inflect($resolved); + } + } + + throw new NotFoundException(sprintf('Alias (%s) is not being managed by the container or delegates', $id)); + } + + /** + * {@inheritdoc} + */ + public function has($id) : bool + { + if ($this->definitions->has($id)) { + return true; + } + + if ($this->definitions->hasTag($id)) { + return true; + } + + if ($this->providers->provides($id)) { + return true; + } + + foreach ($this->delegates as $delegate) { + if ($delegate->has($id)) { + return true; + } + } + + return false; + } + + /** + * Allows for manipulation of specific types on resolution. + * + * @param string $type + * @param callable|null $callback + * + * @return InflectorInterface + */ + public function inflector(string $type, callable $callback = null) : InflectorInterface + { + return $this->inflectors->add($type, $callback); + } + + /** + * Delegate a backup container to be checked for services if it + * cannot be resolved via this container. + * + * @param ContainerInterface $container + * + * @return self + */ + public function delegate(ContainerInterface $container) : self + { + $this->delegates[] = $container; + + if ($container instanceof ContainerAwareInterface) { + $container->setLeagueContainer($this); + } + + return $this; + } +} diff --git a/src/Internal/Vendor/League/Container/ContainerAwareInterface.php b/src/Internal/Vendor/League/Container/ContainerAwareInterface.php new file mode 100644 index 00000000000..e2b7be309d0 --- /dev/null +++ b/src/Internal/Vendor/League/Container/ContainerAwareInterface.php @@ -0,0 +1,40 @@ +container = $container; + + return $this; + } + + /** + * Get the container. + * + * @return ContainerInterface + */ + public function getContainer() : ContainerInterface + { + if ($this->container instanceof ContainerInterface) { + return $this->container; + } + + throw new ContainerException('No container implementation has been set.'); + } + + /** + * Set a container. + * + * @param Container $container + * + * @return self + */ + public function setLeagueContainer(Container $container) : ContainerAwareInterface + { + $this->container = $container; + $this->leagueContainer = $container; + + return $this; + } + + /** + * Get the container. + * + * @return Container + */ + public function getLeagueContainer() : Container + { + if ($this->leagueContainer instanceof Container) { + return $this->leagueContainer; + } + + throw new ContainerException('No container implementation has been set.'); + } +} diff --git a/src/Internal/Vendor/League/Container/Definition/Definition.php b/src/Internal/Vendor/League/Container/Definition/Definition.php new file mode 100644 index 00000000000..f49a6835361 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Definition/Definition.php @@ -0,0 +1,274 @@ +alias = $id; + $this->concrete = $concrete; + } + + /** + * {@inheritdoc} + */ + public function addTag(string $tag) : DefinitionInterface + { + $this->tags[$tag] = true; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function hasTag(string $tag) : bool + { + return isset($this->tags[$tag]); + } + + /** + * {@inheritdoc} + */ + public function setAlias(string $id) : DefinitionInterface + { + $this->alias = $id; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getAlias() : string + { + return $this->alias; + } + + /** + * {@inheritdoc} + */ + public function setShared(bool $shared = true) : DefinitionInterface + { + $this->shared = $shared; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function isShared() : bool + { + return $this->shared; + } + + /** + * {@inheritdoc} + */ + public function getConcrete() + { + return $this->concrete; + } + + /** + * {@inheritdoc} + */ + public function setConcrete($concrete) : DefinitionInterface + { + $this->concrete = $concrete; + $this->resolved = null; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addArgument($arg) : DefinitionInterface + { + $this->arguments[] = $arg; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addArguments(array $args) : DefinitionInterface + { + foreach ($args as $arg) { + $this->addArgument($arg); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addMethodCall(string $method, array $args = []) : DefinitionInterface + { + $this->methods[] = [ + 'method' => $method, + 'arguments' => $args + ]; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addMethodCalls(array $methods = []) : DefinitionInterface + { + foreach ($methods as $method => $args) { + $this->addMethodCall($method, $args); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function resolve(bool $new = false) + { + $concrete = $this->concrete; + + if ($this->isShared() && $this->resolved !== null && $new === false) { + return $this->resolved; + } + + if (is_callable($concrete)) { + $concrete = $this->resolveCallable($concrete); + } + + if ($concrete instanceof RawArgumentInterface) { + $this->resolved = $concrete->getValue(); + + return $concrete->getValue(); + } + + if ($concrete instanceof ClassNameInterface) { + $concrete = $concrete->getClassName(); + } + + if (is_string($concrete) && class_exists($concrete)) { + $concrete = $this->resolveClass($concrete); + } + + if (is_object($concrete)) { + $concrete = $this->invokeMethods($concrete); + } + + $this->resolved = $concrete; + + return $concrete; + } + + /** + * Resolve a callable. + * + * @param callable $concrete + * + * @return mixed + */ + protected function resolveCallable(callable $concrete) + { + $resolved = $this->resolveArguments($this->arguments); + + return call_user_func_array($concrete, $resolved); + } + + /** + * Resolve a class. + * + * @param string $concrete + * + * @return object + * + * @throws ReflectionException + */ + protected function resolveClass(string $concrete) + { + $resolved = $this->resolveArguments($this->arguments); + $reflection = new ReflectionClass($concrete); + + return $reflection->newInstanceArgs($resolved); + } + + /** + * Invoke methods on resolved instance. + * + * @param object $instance + * + * @return object + */ + protected function invokeMethods($instance) + { + foreach ($this->methods as $method) { + $args = $this->resolveArguments($method['arguments']); + + /** @var callable $callable */ + $callable = [$instance, $method['method']]; + call_user_func_array($callable, $args); + } + + return $instance; + } +} diff --git a/src/Internal/Vendor/League/Container/Definition/DefinitionAggregate.php b/src/Internal/Vendor/League/Container/Definition/DefinitionAggregate.php new file mode 100644 index 00000000000..14c7c927d68 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Definition/DefinitionAggregate.php @@ -0,0 +1,124 @@ +definitions = array_filter($definitions, function ($definition) { + return ($definition instanceof DefinitionInterface); + }); + } + + /** + * {@inheritdoc} + */ + public function add(string $id, $definition, bool $shared = false) : DefinitionInterface + { + if (!$definition instanceof DefinitionInterface) { + $definition = new Definition($id, $definition); + } + + $this->definitions[] = $definition + ->setAlias($id) + ->setShared($shared) + ; + + return $definition; + } + + /** + * {@inheritdoc} + */ + public function has(string $id) : bool + { + foreach ($this->getIterator() as $definition) { + if ($id === $definition->getAlias()) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function hasTag(string $tag) : bool + { + foreach ($this->getIterator() as $definition) { + if ($definition->hasTag($tag)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getDefinition(string $id) : DefinitionInterface + { + foreach ($this->getIterator() as $definition) { + if ($id === $definition->getAlias()) { + return $definition->setLeagueContainer($this->getLeagueContainer()); + } + } + + throw new NotFoundException(sprintf('Alias (%s) is not being handled as a definition.', $id)); + } + + /** + * {@inheritdoc} + */ + public function resolve(string $id, bool $new = false) + { + return $this->getDefinition($id)->resolve($new); + } + + /** + * {@inheritdoc} + */ + public function resolveTagged(string $tag, bool $new = false) : array + { + $arrayOf = []; + + foreach ($this->getIterator() as $definition) { + if ($definition->hasTag($tag)) { + $arrayOf[] = $definition->setLeagueContainer($this->getLeagueContainer())->resolve($new); + } + } + + return $arrayOf; + } + + /** + * {@inheritdoc} + */ + public function getIterator() : Generator + { + $count = count($this->definitions); + + for ($i = 0; $i < $count; $i++) { + yield $this->definitions[$i]; + } + } +} diff --git a/src/Internal/Vendor/League/Container/Definition/DefinitionAggregateInterface.php b/src/Internal/Vendor/League/Container/Definition/DefinitionAggregateInterface.php new file mode 100644 index 00000000000..7b8f05700a1 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Definition/DefinitionAggregateInterface.php @@ -0,0 +1,67 @@ +type = $type; + $this->callback = $callback; + } + + /** + * {@inheritdoc} + */ + public function getType() : string + { + return $this->type; + } + + /** + * {@inheritdoc} + */ + public function invokeMethod(string $name, array $args) : InflectorInterface + { + $this->methods[$name] = $args; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function invokeMethods(array $methods) : InflectorInterface + { + foreach ($methods as $name => $args) { + $this->invokeMethod($name, $args); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setProperty(string $property, $value) : InflectorInterface + { + $this->properties[$property] = $this->resolveArguments([$value])[0]; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setProperties(array $properties) : InflectorInterface + { + foreach ($properties as $property => $value) { + $this->setProperty($property, $value); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function inflect($object) + { + $properties = $this->resolveArguments(array_values($this->properties)); + $properties = array_combine(array_keys($this->properties), $properties); + + // array_combine() can technically return false + foreach ($properties ?: [] as $property => $value) { + $object->{$property} = $value; + } + + foreach ($this->methods as $method => $args) { + $args = $this->resolveArguments($args); + + /** @var callable $callable */ + $callable = [$object, $method]; + call_user_func_array($callable, $args); + } + + if ($this->callback !== null) { + call_user_func($this->callback, $object); + } + } +} diff --git a/src/Internal/Vendor/League/Container/Inflector/InflectorAggregate.php b/src/Internal/Vendor/League/Container/Inflector/InflectorAggregate.php new file mode 100644 index 00000000000..62f9b2533ec --- /dev/null +++ b/src/Internal/Vendor/League/Container/Inflector/InflectorAggregate.php @@ -0,0 +1,58 @@ +inflectors[] = $inflector; + + return $inflector; + } + + /** + * {@inheritdoc} + */ + public function getIterator() : Generator + { + $count = count($this->inflectors); + + for ($i = 0; $i < $count; $i++) { + yield $this->inflectors[$i]; + } + } + + /** + * {@inheritdoc} + */ + public function inflect($object) + { + foreach ($this->getIterator() as $inflector) { + $type = $inflector->getType(); + + if (! $object instanceof $type) { + continue; + } + + $inflector->setLeagueContainer($this->getLeagueContainer()); + $inflector->inflect($object); + } + + return $object; + } +} diff --git a/src/Internal/Vendor/League/Container/Inflector/InflectorAggregateInterface.php b/src/Internal/Vendor/League/Container/Inflector/InflectorAggregateInterface.php new file mode 100644 index 00000000000..a2ee69afd17 --- /dev/null +++ b/src/Internal/Vendor/League/Container/Inflector/InflectorAggregateInterface.php @@ -0,0 +1,27 @@ +cacheResolutions === true && array_key_exists($id, $this->cache)) { + return $this->cache[$id]; + } + + if (! $this->has($id)) { + throw new NotFoundException( + sprintf('Alias (%s) is not an existing class and therefore cannot be resolved', $id) + ); + } + + $reflector = new ReflectionClass($id); + $construct = $reflector->getConstructor(); + + $resolution = $construct === null + ? new $id + : $resolution = $reflector->newInstanceArgs($this->reflectArguments($construct, $args)) + ; + + if ($this->cacheResolutions === true) { + $this->cache[$id] = $resolution; + } + + return $resolution; + } + + /** + * {@inheritdoc} + */ + public function has($id) : bool + { + return class_exists($id); + } + + /** + * Invoke a callable via the container. + * + * @param callable $callable + * @param array $args + * + * @return mixed + * + * @throws ReflectionException + */ + public function call(callable $callable, array $args = []) + { + if (is_string($callable) && strpos($callable, '::') !== false) { + $callable = explode('::', $callable); + } + + if (is_array($callable)) { + if (is_string($callable[0])) { + $callable[0] = $this->getContainer()->get($callable[0]); + } + + $reflection = new ReflectionMethod($callable[0], $callable[1]); + + if ($reflection->isStatic()) { + $callable[0] = null; + } + + return $reflection->invokeArgs($callable[0], $this->reflectArguments($reflection, $args)); + } + + if (is_object($callable)) { + $reflection = new ReflectionMethod($callable, '__invoke'); + + return $reflection->invokeArgs($callable, $this->reflectArguments($reflection, $args)); + } + + $reflection = new ReflectionFunction(\Closure::fromCallable($callable)); + + return $reflection->invokeArgs($this->reflectArguments($reflection, $args)); + } + + /** + * Whether the container should default to caching resolutions and returning + * the cache on following calls. + * + * @param boolean $option + * + * @return self + */ + public function cacheResolutions(bool $option = true) : ContainerInterface + { + $this->cacheResolutions = $option; + + return $this; + } +} diff --git a/src/Internal/Vendor/League/Container/ServiceProvider/AbstractServiceProvider.php b/src/Internal/Vendor/League/Container/ServiceProvider/AbstractServiceProvider.php new file mode 100644 index 00000000000..5289484b6c6 --- /dev/null +++ b/src/Internal/Vendor/League/Container/ServiceProvider/AbstractServiceProvider.php @@ -0,0 +1,46 @@ +provides, true); + } + + /** + * {@inheritdoc} + */ + public function setIdentifier(string $id) : ServiceProviderInterface + { + $this->identifier = $id; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getIdentifier() : string + { + return $this->identifier ?? get_class($this); + } +} diff --git a/src/Internal/Vendor/League/Container/ServiceProvider/BootableServiceProviderInterface.php b/src/Internal/Vendor/League/Container/ServiceProvider/BootableServiceProviderInterface.php new file mode 100644 index 00000000000..6b624a66ae5 --- /dev/null +++ b/src/Internal/Vendor/League/Container/ServiceProvider/BootableServiceProviderInterface.php @@ -0,0 +1,14 @@ +getContainer()->has($provider)) { + $provider = $this->getContainer()->get($provider); + } elseif (is_string($provider) && class_exists($provider)) { + $provider = new $provider; + } + + if (in_array($provider, $this->providers, true)) { + return $this; + } + + if ($provider instanceof ContainerAwareInterface) { + $provider->setLeagueContainer($this->getLeagueContainer()); + } + + if ($provider instanceof BootableServiceProviderInterface) { + $provider->boot(); + } + + if ($provider instanceof ServiceProviderInterface) { + $this->providers[] = $provider; + + return $this; + } + + throw new ContainerException( + 'A service provider must be a fully qualified class name or instance ' . + 'of (\Automattic\WooCommerce\Internal\Vendor\League\Container\ServiceProvider\ServiceProviderInterface)' + ); + } + + /** + * {@inheritdoc} + */ + public function provides(string $service) : bool + { + foreach ($this->getIterator() as $provider) { + if ($provider->provides($service)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function getIterator() : Generator + { + $count = count($this->providers); + + for ($i = 0; $i < $count; $i++) { + yield $this->providers[$i]; + } + } + + /** + * {@inheritdoc} + */ + public function register(string $service) + { + if (false === $this->provides($service)) { + throw new ContainerException( + sprintf('(%s) is not provided by a service provider', $service) + ); + } + + foreach ($this->getIterator() as $provider) { + if (in_array($provider->getIdentifier(), $this->registered, true)) { + continue; + } + + if ($provider->provides($service)) { + $provider->register(); + $this->registered[] = $provider->getIdentifier(); + } + } + } +} diff --git a/src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php b/src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php new file mode 100644 index 00000000000..34a5f315f62 --- /dev/null +++ b/src/Internal/Vendor/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php @@ -0,0 +1,36 @@ +leagueContainer property or the `getLeagueContainer` method + * from the ContainerAwareTrait. + * + * @return void + */ + public function register(); + + /** + * Set a custom id for the service provider. This enables + * registering the same service provider multiple times. + * + * @param string $id + * + * @return self + */ + public function setIdentifier(string $id) : ServiceProviderInterface; + + /** + * The id of the service provider uniquely identifies it, so + * that we can quickly determine if it has already been registered. + * Defaults to get_class($provider). + * + * @return string + */ + public function getIdentifier() : string; +} From 76d8b1665927edcba7459cf5e0a4fe782e91188a Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 9 Nov 2020 13:31:19 -0400 Subject: [PATCH 09/82] remove old setup wizard test --- tests/e2e/utils/src/components.js | 140 ------------------------------ 1 file changed, 140 deletions(-) diff --git a/tests/e2e/utils/src/components.js b/tests/e2e/utils/src/components.js index f8ccd245944..c65f8505957 100644 --- a/tests/e2e/utils/src/components.js +++ b/tests/e2e/utils/src/components.js @@ -202,145 +202,6 @@ const completeOnboardingWizard = async () => { await page.click( 'button.components-guide__finish-button' ); }; -/** - * Complete old setup wizard. - */ -const completeOldSetupWizard = async () => { - // Fill out store setup section details - // Select country where the store is located - await expect( page ).toSelect( 'select[name="store_country"]', config.get( 'addresses.admin.store.country' ) ); - // Fill store's address - first line - await expect( page ).toFill( '#store_address', config.get( 'addresses.admin.store.addressfirstline' ) ); - - // Fill store's address - second line - await expect( page ).toFill( '#store_address_2', config.get( 'addresses.admin.store.addresssecondline' ) ); - - // Fill the city where the store is located - await expect( page ).toFill( '#store_city', config.get( 'addresses.admin.store.city' ) ); - - // Select the state where the store is located - await expect( page ).toSelect( 'select[name="store_state"]', config.get( 'addresses.admin.store.state') ); - - // Fill postcode of the store - await expect( page ).toFill( '#store_postcode', config.get( 'addresses.admin.store.postcode' ) ); - - // Select currency and type of products to sell details - await expect( page ).toSelect( 'select[name="currency_code"]', '\n' + - '\t\t\t\t\t\tUnited States (US) dollar ($ USD)\t\t\t\t\t' ); - await expect( page ).toSelect( 'select[name="product_type"]', 'I plan to sell both physical and digital products' ); - - // Verify that checkbox next to "I will also be selling products or services in person." is not selected - await verifyCheckboxIsUnset( '#woocommerce_sell_in_person' ); - - // Click on "Let's go!" button to move to the next step - await page.$eval( 'button[name=save_step]', elem => elem.click() ); - - // Wait for usage tracking pop-up window to appear - await page.waitForSelector( '#wc-backbone-modal-dialog' ); - await expect( page ).toMatchElement( - '.wc-backbone-modal-header', { text: 'Help improve WooCommerce with usage tracking' } - ); - - await page.waitForSelector( '#wc_tracker_checkbox_dialog' ); - - // Verify that checkbox next to "Enable usage tracking and help improve WooCommerce" is not selected - await verifyCheckboxIsUnset( '#wc_tracker_checkbox_dialog' ); - - await Promise.all( [ - // Click on "Continue" button to move to the next step - page.$eval( '#wc_tracker_submit', elem => elem.click() ), - - // Wait for the Payment section to load - page.waitForNavigation( { waitUntil: 'networkidle0' } ), - ] ); - - // Fill out payment section details - // Turn off Stripe account toggle - await page.click( '.wc-wizard-service-toggle' ); - - await Promise.all( [ - // Click on "Continue" button to move to the next step - page.click( 'button[name=save_step]', { text: 'Continue' } ), - - // Wait for the Shipping section to load - page.waitForNavigation( { waitUntil: 'networkidle0' } ), - ] ); - - // Fill out shipping section details - // Turn off WooCommerce Shipping option - await page.$eval( '#wc_recommended_woocommerce_services', elem => elem.click() ); - - await page.waitForSelector( 'select[name="shipping_zones[domestic][method]"]' ); - await page.waitForSelector( 'select[name="shipping_zones[intl][method]"]' ); - - // Select Flat Rate shipping method for domestic shipping zone - await page.evaluate( () => { - document.querySelector( 'select[name="shipping_zones[domestic][method]"] > option:nth-child(1)' ).selected = true; - let element = document.querySelector( 'select[name="shipping_zones[domestic][method]"]' ); - let event = new Event( 'change', { bubbles: true } ); - event.simulated = true; - element.dispatchEvent( event ); - } ); - - await page.$eval( 'input[name="shipping_zones[domestic][flat_rate][cost]"]', e => e.setAttribute( 'value', '10.00' ) ); - - // Select Flat Rate shipping method for the rest of the world shipping zone - await page.evaluate( () => { - document.querySelector( 'select[name="shipping_zones[intl][method]"] > option:nth-child(1)' ).selected = true; - let element = document.querySelector( 'select[name="shipping_zones[intl][method]"]' ); - let event = new Event( 'change', { bubbles: true } ); - event.simulated = true; - element.dispatchEvent( event ); - } ); - - await page.$eval( 'input[name="shipping_zones[intl][flat_rate][cost]"]', e => e.setAttribute( 'value', '20.00' ) ); - - // Select product weight and product dimensions options - await expect( page ).toSelect( 'select[name="weight_unit"]', 'Pounds' ); - await expect( page ).toSelect( 'select[name="dimension_unit"]', 'Inches' ); - - await Promise.all( [ - // Click on "Continue" button to move to the next step - page.click( 'button[name=save_step]', { text: 'Continue' } ), - - // Wait for the Recommended section to load - page.waitForNavigation( { waitUntil: 'networkidle0' } ), - ] ); - - // Fill out recommended section details - // Turn off Storefront Theme option - await page.waitForSelector( '#wc_recommended_storefront_theme', { visible: true } ); - await page.$eval( '#wc_recommended_storefront_theme', elem => elem.click() ); - - // Turn off Automated Taxes option - await page.waitForSelector( '#wc_recommended_automated_taxes', { visible: true } ); - await page.$eval( '#wc_recommended_automated_taxes', elem => elem.click() ); - - // Turn off Mailchimp option - await page.waitForSelector( '#wc_recommended_mailchimp', { visible: true } ); - await page.$eval( '#wc_recommended_mailchimp', elem => elem.click() ); - - // Turn off Facebook option - await page.waitForSelector( '#wc_recommended_facebook', { visible: true } ); - await page.$eval( '#wc_recommended_facebook', elem => elem.click() ); - - await Promise.all( [ - // Click on "Continue" button to move to the next step - page.click( 'button[name=save_step]', { text: 'Continue' } ), - - // Wait for the Jetpack section to load - page.waitForNavigation( { waitUntil: 'networkidle0' } ), - ] ); - - // Skip activate Jetpack section - // Click on "Skip this step" in order to skip Jetpack installation - await page.click( '.wc-setup-footer-links' ); - - // Finish Setup Wizard - Ready! section - // Visit Dashboard - await StoreOwnerFlow.openDashboard(); -} ; - /** * Create simple product. */ @@ -484,7 +345,6 @@ const createVariableProduct = async () => { }; export { - completeOldSetupWizard, completeOnboardingWizard, createSimpleProduct, createVariableProduct, From 838194e3d77fa0697b72d9eefded773c536a039c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Nov 2020 10:00:55 -0300 Subject: [PATCH 10/82] Remove Dockerfile as it is not used anymore This file was added in the past to help set up the old E2E testing infrastructure (see #25105), but the new E2E setup doesn't use it (see https://github.com/woocommerce/woocommerce/pull/28173#issuecomment-725617312). --- Dockerfile | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 538e25c9a70..00000000000 --- a/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM wordpress:5.4.2 From bb38673dadebf5baf4c3f66c0164d60aa1d5f0c6 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Fri, 13 Nov 2020 09:22:06 -0800 Subject: [PATCH 11/82] Prepared branch for 4.9 --- includes/class-woocommerce.php | 2 +- package.json | 2 +- readme.txt | 2 +- woocommerce.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index a4059876149..a7dcc1d9d9c 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -22,7 +22,7 @@ final class WooCommerce { * * @var string */ - public $version = '4.8.0'; + public $version = '4.9.0'; /** * WooCommerce Schema version. diff --git a/package.json b/package.json index 6c9cd0a0aa5..513ddc6a1d5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "woocommerce", "title": "WooCommerce", - "version": "4.8.0", + "version": "4.9.0", "homepage": "https://woocommerce.com/", "repository": { "type": "git", diff --git a/readme.txt b/readme.txt index 1b90cfa8f4e..31d71a77978 100644 --- a/readme.txt +++ b/readme.txt @@ -160,7 +160,7 @@ WooCommerce comes with some sample data you can use to see how products look; im == Changelog == -= 4.8.0 - 2020-12-xx = += 4.9.0 - 2021-01-xx = [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/changelog.txt). diff --git a/woocommerce.php b/woocommerce.php index 3e0bc877ce4..565db10a03b 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce * Plugin URI: https://woocommerce.com/ * Description: An eCommerce toolkit that helps you sell anything. Beautifully. - * Version: 4.8.0-dev + * Version: 4.9.0-dev * Author: Automattic * Author URI: https://woocommerce.com * Text Domain: woocommerce From c491bd45aabbe119661a79168b58531bfd773b3c Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Fri, 13 Nov 2020 09:43:01 -0800 Subject: [PATCH 12/82] Updated lock file --- composer.lock | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/composer.lock b/composer.lock index 776e044bab7..b78f6116b82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "928d8825a02fc4217b3af36a83c2fbc8", + "content-hash": "6494b4d4b956386e32381541ebd79839", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -493,22 +493,27 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.46", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" + "reference": "4d882dced7b995d5274293039370148e291808f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2", + "reference": "4d882dced7b995d5274293039370148e291808f2", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=5.5.9" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" @@ -522,14 +527,14 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, { "name": "Jean-Fran̤ois Simon", "email": "jeanfrancois.simon@sensiolabs.com" }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -538,23 +543,9 @@ "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v3.4.46" + "source": "https://github.com/symfony/css-selector/tree/master" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2017-05-01T15:01:29+00:00" }, { "name": "woocommerce/action-scheduler", @@ -758,7 +749,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "7.1" + "php": "7.0" }, "plugin-api-version": "2.0.0" } From 5cbcdcd92cd1099fb7e88ecabf1bec691e73594b Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Fri, 30 Oct 2020 18:23:55 -0300 Subject: [PATCH 13/82] Add requires_php support With this check, we're able to avoid updates when the PHP version is not supported --- includes/admin/helper/class-wc-helper-updater.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/admin/helper/class-wc-helper-updater.php b/includes/admin/helper/class-wc-helper-updater.php index e187231753e..e75d2a76649 100644 --- a/includes/admin/helper/class-wc-helper-updater.php +++ b/includes/admin/helper/class-wc-helper-updater.php @@ -57,6 +57,10 @@ class WC_Helper_Updater { 'upgrade_notice' => $data['upgrade_notice'], ); + if ( $data['requires_php'] ) { + $item['requires_php'] = $data['requires_php']; + } + // We don't want to deliver a valid upgrade package when their subscription has expired. // To avoid the generic "no_package" error that empty strings give, we will store an // indication of expiration for the `upgrader_pre_download` filter to error on. From c2b066edcbaddb62ca41dbd0cc3ccdcc3fea132c Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Fri, 13 Nov 2020 16:37:33 -0300 Subject: [PATCH 14/82] Fix requires_php check --- includes/admin/helper/class-wc-helper-updater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/helper/class-wc-helper-updater.php b/includes/admin/helper/class-wc-helper-updater.php index e75d2a76649..25ec134f639 100644 --- a/includes/admin/helper/class-wc-helper-updater.php +++ b/includes/admin/helper/class-wc-helper-updater.php @@ -57,7 +57,7 @@ class WC_Helper_Updater { 'upgrade_notice' => $data['upgrade_notice'], ); - if ( $data['requires_php'] ) { + if ( isset( $data['requires_php'] ) ) { $item['requires_php'] = $data['requires_php']; } From c2eb62fd3b8b0a50c591ffc514a8a70c8126b129 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Fri, 13 Nov 2020 12:05:28 -0800 Subject: [PATCH 15/82] Locked Composer at 2.0.6 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index b7b349f9d38..59450d7f641 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,3 +88,7 @@ branches: - master - /^\d+\.\d+(\.\d+)?(-\S*)?$/ - /^release\// + +# Composer 2.0.7 introduced a change that broke the jetpack autoloader in PHP 7.0 - 7.3. +before_install: + - composer self-update 2.0.6 From b506627528402de236d928c5f1c23ba02e602269 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 13 Nov 2020 17:49:27 -0300 Subject: [PATCH 16/82] Keep WC_Checkout::process_checkout() backwards compatible --- includes/class-wc-checkout.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 671961040ac..024486b1980 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -1158,7 +1158,16 @@ class WC_Checkout { do_action( 'woocommerce_checkout_order_processed', $order_id, $posted_data, $order ); - if ( $order->needs_payment() ) { + /** + * Note that woocommerce_cart_needs_payment is only used in + * WC_Checkout::process_checkout() to keep backwards compatibility. + * Use woocommerce_order_needs_payment instead. + * + * Note that at this point you can't rely on the Cart Object anymore, + * since it could be empty see: + * https://github.com/woocommerce/woocommerce/issues/24631 + */ + if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), wc()->cart ) ) { $this->process_order_payment( $order_id, $posted_data['payment_method'] ); } else { $this->process_order_without_payment( $order_id ); From f8f1417d72e335a0e34d32dade31a358e2f4fa32 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 13 Nov 2020 17:57:29 -0300 Subject: [PATCH 17/82] Fixed function name --- includes/class-wc-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 024486b1980..6e3cf6dd492 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -1167,7 +1167,7 @@ class WC_Checkout { * since it could be empty see: * https://github.com/woocommerce/woocommerce/issues/24631 */ - if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), wc()->cart ) ) { + if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), WC()->cart ) ) { $this->process_order_payment( $order_id, $posted_data['payment_method'] ); } else { $this->process_order_without_payment( $order_id ); From ea888a4a21a4958f1ba59e4f81774d1542eeda52 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Mon, 16 Nov 2020 09:04:15 -0800 Subject: [PATCH 18/82] Revert "Added support for file in checkout ajax." --- assets/js/frontend/checkout.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/js/frontend/checkout.js b/assets/js/frontend/checkout.js index bdbd5e62569..56ebd18a917 100644 --- a/assets/js/frontend/checkout.js +++ b/assets/js/frontend/checkout.js @@ -507,9 +507,8 @@ jQuery( function( $ ) { $.ajax({ type: 'POST', url: wc_checkout_params.checkout_url, - data: new FormData( this ), - contentType: false, - processData: false, + data: $form.serialize(), + dataType: 'json', success: function( result ) { // Detach the unload handler that prevents a reload / redirect wc_checkout_form.detachUnloadEventsOnSubmit(); From 655166b6da048ac02e2869730413608385943082 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 17 Nov 2020 09:04:25 -0600 Subject: [PATCH 19/82] Adjust margin on price, related product h2, and variations table --- assets/css/twenty-twenty-one.scss | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 1d86f162d8f..b834c32bf82 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -530,7 +530,7 @@ dl.variation, margin-bottom: 8rem; p.price { - margin-bottom: 3.5rem; + margin-bottom: 2rem; } } @@ -605,6 +605,7 @@ dl.variation, } table.variations { + margin: 1rem 0; label { margin: 0; @@ -925,6 +926,10 @@ a.reset_variations { .related.products, .up-sells { + h2 { + margin-bottom: 2rem; + } + clear: both; ul.products { @@ -2285,7 +2290,6 @@ a.reset_variations { } .related.products { - ul.products { display: flex; flex-direction: column; From 97eea98a233344d68341d244d537df2476fd8e19 Mon Sep 17 00:00:00 2001 From: Adam Heckler Date: Tue, 17 Nov 2020 10:21:20 -0500 Subject: [PATCH 20/82] Return default date/time formats if blank Fixes #28319 --- includes/wc-formatting-functions.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index 46434075850..3613e4183c3 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -638,7 +638,12 @@ function wc_let_to_num( $size ) { * @return string */ function wc_date_format() { - return apply_filters( 'woocommerce_date_format', get_option( 'date_format' ) ); + $date_format = get_option( 'date_format' ); + if ( empty( $date_format ) ) { + # Return default date format if the option is empty + $date_format = 'F j, Y'; + } + return apply_filters( 'woocommerce_date_format', $date_format ); } /** @@ -647,7 +652,12 @@ function wc_date_format() { * @return string */ function wc_time_format() { - return apply_filters( 'woocommerce_time_format', get_option( 'time_format' ) ); + $time_format = get_option( 'time_format' ); + if ( empty( $time_format ) ) { + # Return default time format if the option is empty + $time_format = 'g:i a'; + } + return apply_filters( 'woocommerce_time_format', $time_format ); } /** From 07d88554887e3f4810851d8d40b0b290c3eb28e7 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 17 Nov 2020 09:37:56 -0600 Subject: [PATCH 21/82] Fix related products alignment at lower breakpoints --- assets/css/twenty-twenty-one.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index b834c32bf82..a817dfdb7f7 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2173,6 +2173,15 @@ a.reset_variations { .woocommerce, .woocommerce-page { + .related.products { + ul.products[class*=columns-] { + li.product { + padding: 0 2vw 3em 0 !important; + margin-bottom: 2em; + } + } + } + ul.products[class*=columns-] { li.product { From a05e55d119039ef70562c01cfed8c40f46953dcc Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 17 Nov 2020 09:48:42 -0600 Subject: [PATCH 22/82] Improve the readability of cart confirmation --- assets/css/twenty-twenty-one.scss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index a817dfdb7f7..c80cdfff3d6 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -211,11 +211,6 @@ a.button { } } -.woocommerce-message { - background: #eee; - color: $body-color; -} - .woocommerce-error { color: #fff; background: #b22222; @@ -245,6 +240,7 @@ a.button { } } +.woocommerce-message, .woocommerce-info { background: #eee; color: #000; @@ -2012,7 +2008,7 @@ a.reset_variations { } input[type=checkbox] { - width: 25px !important; + width: 25px !important; } } @@ -2174,7 +2170,9 @@ a.reset_variations { .woocommerce-page { .related.products { + ul.products[class*=columns-] { + li.product { padding: 0 2vw 3em 0 !important; margin-bottom: 2em; @@ -2299,6 +2297,7 @@ a.reset_variations { } .related.products { + ul.products { display: flex; flex-direction: column; From c3487785d518de91448e0cd2dd9591e5daa1fea2 Mon Sep 17 00:00:00 2001 From: Adam Heckler Date: Tue, 17 Nov 2020 10:54:53 -0500 Subject: [PATCH 23/82] Code standards fixes --- includes/wc-formatting-functions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index 3613e4183c3..b77115bafb7 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -638,10 +638,10 @@ function wc_let_to_num( $size ) { * @return string */ function wc_date_format() { - $date_format = get_option( 'date_format' ); + $date_format = get_option( 'date_format' ); if ( empty( $date_format ) ) { - # Return default date format if the option is empty - $date_format = 'F j, Y'; + // Return default date format if the option is empty + $date_format = 'F j, Y'; } return apply_filters( 'woocommerce_date_format', $date_format ); } @@ -652,12 +652,12 @@ function wc_date_format() { * @return string */ function wc_time_format() { - $time_format = get_option( 'time_format' ); + $time_format = get_option( 'time_format' ); if ( empty( $time_format ) ) { - # Return default time format if the option is empty - $time_format = 'g:i a'; + // Return default time format if the option is empty + $time_format = 'g:i a'; } - return apply_filters( 'woocommerce_time_format', $time_format ); + return apply_filters( 'woocommerce_time_format', $time_format ); } /** From b0580f0eb43c4b28bb90c3163e71d601f194e207 Mon Sep 17 00:00:00 2001 From: Adam Heckler Date: Tue, 17 Nov 2020 12:31:17 -0500 Subject: [PATCH 24/82] More code standards fixes --- includes/wc-formatting-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index b77115bafb7..cbee6a2eedb 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -640,7 +640,7 @@ function wc_let_to_num( $size ) { function wc_date_format() { $date_format = get_option( 'date_format' ); if ( empty( $date_format ) ) { - // Return default date format if the option is empty + // Return default date format if the option is empty. $date_format = 'F j, Y'; } return apply_filters( 'woocommerce_date_format', $date_format ); @@ -654,7 +654,7 @@ function wc_date_format() { function wc_time_format() { $time_format = get_option( 'time_format' ); if ( empty( $time_format ) ) { - // Return default time format if the option is empty + // Return default time format if the option is empty. $time_format = 'g:i a'; } return apply_filters( 'woocommerce_time_format', $time_format ); From 5c8491c8626c62832de2d347990ac23a51c872cb Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Sat, 14 Nov 2020 15:25:34 -0300 Subject: [PATCH 25/82] Remove jQuery code that does nothing This commit replaces a block of jQuery code that I believe does nothing. I found it while starting the work to make our JS code compatible with jQuery 3 as it uses jQuery.fn.keyup() which has been deprecated. As far as I can understand, this block of code is supposed to change the focus to the coupon description when the user hits the tab key while the focus is on the title field. It doesn't work because the keyup event is not fired for the tab key. The current behavior is that when the user hits the tab key, the focus changes to the "Generate coupon code" button, and if the tab key is pressed another time, the focus changes to the description text field. Which seems fine to me and that is why I'm suggesting we remove this code instead of fixing it. I believe it was added in this c15b8e817cb523a5534d935bcb138e47642f76b4 commit six years ago and unfortunatelly the commit doesn't provide much information on why it was added. --- assets/js/admin/meta-boxes.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/assets/js/admin/meta-boxes.js b/assets/js/admin/meta-boxes.js index 13e2c4a56c4..daf756bf17f 100644 --- a/assets/js/admin/meta-boxes.js +++ b/assets/js/admin/meta-boxes.js @@ -16,18 +16,6 @@ jQuery( function ( $ ) { runTipTip(); - // Allow Tabbing - $( '#titlediv' ).find( '#title' ).keyup( function( event ) { - var code = event.keyCode || event.which; - - // Tab key - if ( code === '9' && $( '#woocommerce-coupon-description' ).length > 0 ) { - event.stopPropagation(); - $( '#woocommerce-coupon-description' ).focus(); - return false; - } - }); - $( '.wc-metaboxes-wrapper' ).on( 'click', '.wc-metabox > h3', function() { $( this ).parent( '.wc-metabox' ).toggleClass( 'closed' ).toggleClass( 'open' ); }); From f296b36667c8f9645bff0459eac4dfc89c79a2a3 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Wed, 18 Nov 2020 09:14:17 +0100 Subject: [PATCH 26/82] Get Mozart package from original source instead of our fork. Since the pull requests with required functionality have been accepted and merged, we can now use the original repository instead of Woo's fork. --- bin/composer/mozart/composer.json | 10 ++-------- bin/composer/mozart/composer.lock | 31 ++++++++++--------------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/bin/composer/mozart/composer.json b/bin/composer/mozart/composer.json index 505369afa88..c9e4e686138 100644 --- a/bin/composer/mozart/composer.json +++ b/bin/composer/mozart/composer.json @@ -1,11 +1,5 @@ { "require-dev": { - "coenjacobs/mozart": "dev-with-improvements" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/woocommerce/mozart" - } - ] + "coenjacobs/mozart": "dev-master" + } } diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index e40c3c9f752..eb3c6d96d6c 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1f8c8a5a27836dae880f7d54a6b4234a", + "content-hash": "eb3fb853d332b8bc18796e0fe3546427", "packages": [], "packages-dev": [ { "name": "coenjacobs/mozart", - "version": "dev-with-improvements", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/woocommerce/mozart.git", - "reference": "14ead9f55aff907fc345fc5df464728400005a26" + "url": "https://github.com/coenjacobs/mozart.git", + "reference": "b063c0b3c9923fc763e89376e3d671ce450a839a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/mozart/zipball/14ead9f55aff907fc345fc5df464728400005a26", - "reference": "14ead9f55aff907fc345fc5df464728400005a26", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/b063c0b3c9923fc763e89376e3d671ce450a839a", + "reference": "b063c0b3c9923fc763e89376e3d671ce450a839a", "shasum": "" }, "require": { @@ -41,15 +41,7 @@ "CoenJacobs\\Mozart\\": "src/" } }, - "scripts": { - "lint": [ - "composer validate", - "phpcs" - ], - "test": [ - "phpunit" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -60,16 +52,13 @@ } ], "description": "Composes all dependencies as a package inside a WordPress plugin", - "support": { - "source": "https://github.com/woocommerce/mozart/tree/with-improvements" - }, "funding": [ { - "type": "github", - "url": "https://github.com/coenjacobs" + "url": "https://github.com/coenjacobs", + "type": "github" } ], - "time": "2020-10-30T09:56:44+00:00" + "time": "2020-11-16T21:14:14+00:00" }, { "name": "league/flysystem", From 846a7fb3d12f515af68532c6cb0c48167a93892a Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Wed, 18 Nov 2020 09:39:46 +0100 Subject: [PATCH 27/82] Declare PHP version as 7.2 in composer.json for Mozart. This way it won't throw errors when building in 7.0 or 7.1 (required for CI). Still, an error will be thrown when manually running move-vendor-packages.sh in 7.0 or 7.1. --- bin/composer/mozart/composer.json | 5 + bin/composer/mozart/composer.lock | 446 +++--------------------------- 2 files changed, 45 insertions(+), 406 deletions(-) diff --git a/bin/composer/mozart/composer.json b/bin/composer/mozart/composer.json index c9e4e686138..bc84e4ad217 100644 --- a/bin/composer/mozart/composer.json +++ b/bin/composer/mozart/composer.json @@ -1,5 +1,10 @@ { "require-dev": { "coenjacobs/mozart": "dev-master" + }, + "config": { + "platform": { + "php": "7.2" + } } } diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index eb3c6d96d6c..10b7d6a0ec7 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb3fb853d332b8bc18796e0fe3546427", + "content-hash": "cbcce1648bdb890ae805e1afb7396e3c", "packages": [], "packages-dev": [ { @@ -62,29 +62,28 @@ }, { "name": "league/flysystem", - "version": "1.1.3", + "version": "1.0.70", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + "reference": "585824702f534f8d3cf7fab7225e8466cc4b7493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/585824702f534f8d3cf7fab7225e8466cc4b7493", + "reference": "585824702f534f8d3cf7fab7225e8466cc4b7493", "shasum": "" }, "require": { "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" + "php": ">=5.5.9" }, "conflict": { "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" + "phpspec/phpspec": "^3.4 || ^4.0 || ^5.0 || ^6.0", + "phpunit/phpunit": "^5.7.26" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -149,58 +148,7 @@ "type": "other" } ], - "time": "2020-08-23T07:39:11+00:00" - }, - { - "name": "league/mime-type-detection", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.36", - "phpunit/phpunit": "^8.5.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "time": "2020-10-18T11:50:25+00:00" + "time": "2020-07-26T07:20:36+00:00" }, { "name": "psr/container", @@ -253,44 +201,42 @@ }, { "name": "symfony/console", - "version": "v5.1.8", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e" + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2" }, "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/process": "<3.3" }, "provide": { "psr/log-implementation": "1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -337,24 +283,24 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/finder", - "version": "v5.1.8", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/finder/zipball/26f63b8d4e92f2eecd90f6791a563ebb001abe31", + "reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.1.3" }, "type": "library", "autoload": { @@ -395,242 +341,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c", - "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "727d1096295d807c309fb01a851577302394c897" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897", - "reference": "727d1096295d807c309fb01a851577302394c897", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -867,20 +578,20 @@ }, { "name": "symfony/service-contracts", - "version": "v2.2.0", + "version": "v1.1.9", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "psr/container": "^1.0" }, "suggest": { @@ -889,7 +600,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "1.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -939,87 +650,7 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" - }, - { - "name": "symfony/string", - "version": "v5.1.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "files": [ - "Resources/functions.php" - ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony String component", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-07-06T13:19:58+00:00" } ], "aliases": [], @@ -1031,5 +662,8 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], + "platform-overrides": { + "php": "7.2" + }, "plugin-api-version": "1.1.0" } From bf92437b23bad52fcb53157b007cd9b947a5e7d1 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Wed, 18 Nov 2020 13:25:53 -0600 Subject: [PATCH 28/82] Improve margin beneath short description --- assets/css/twenty-twenty-one.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index c80cdfff3d6..8768e632cfd 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -528,6 +528,10 @@ dl.variation, p.price { margin-bottom: 2rem; } + + .woocommerce-product-details__short-description { + margin-bottom: 1rem; + } } .woocommerce-product-rating { From 192611980a7e872bc70b5dca13b908fd4b6b518f Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Wed, 18 Nov 2020 13:39:38 -0600 Subject: [PATCH 29/82] Improve content-area padding at smaller viewports --- assets/css/twenty-twenty-one.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 8768e632cfd..4ba36cbf47d 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2208,6 +2208,10 @@ a.reset_variations { @media only screen and (max-width: 768px) { + .woocommerce section.content-area { + padding-top: 0; + } + #main { .woocommerce { From c9f413d2978915a695616499f162318077579b84 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 18 Nov 2020 13:54:20 -0800 Subject: [PATCH 30/82] Created dummy `woocommerce/woocommerce-lib` package to contain dependencies In order to avoid problems posed by potentially including the unconverted dependencies in the root autoloader, this package will hold all dependencies that require conflict avoidance. --- .gitignore | 3 +- bin/{move-vendor-packages.sh => build-lib.sh} | 14 +- bin/composer/mozart/composer.lock | 33 +++- bin/composer/phpcs/composer.lock | 32 +++- bin/composer/phpunit/composer.lock | 50 +++++- bin/composer/wp/composer.lock | 39 ++++- composer.json | 28 ++- composer.lock | 160 ++++++++++-------- lib/README.md | 31 ++++ lib/composer.json | 51 ++++++ lib/composer.lock | 154 +++++++++++++++++ .../Argument/ArgumentResolverInterface.php | 4 +- .../Argument/ArgumentResolverTrait.php | 8 +- .../League/Container/Argument/ClassName.php | 2 +- .../Container/Argument/ClassNameInterface.php | 2 +- .../Argument/ClassNameWithOptionalValue.php | 2 +- .../League/Container/Argument/RawArgument.php | 2 +- .../Argument/RawArgumentInterface.php | 2 +- .../packages}/League/Container/Container.php | 10 +- .../Container/ContainerAwareInterface.php | 2 +- .../League/Container/ContainerAwareTrait.php | 4 +- .../Container/Definition/Definition.php | 6 +- .../Definition/DefinitionAggregate.php | 6 +- .../DefinitionAggregateInterface.php | 4 +- .../Definition/DefinitionInterface.php | 4 +- .../Exception/ContainerException.php | 2 +- .../Container/Exception/NotFoundException.php | 2 +- .../League/Container/Inflector/Inflector.php | 8 +- .../Inflector/InflectorAggregate.php | 4 +- .../Inflector/InflectorAggregateInterface.php | 4 +- .../Inflector/InflectorInterface.php | 2 +- .../League/Container/ReflectionContainer.php | 6 +- .../AbstractServiceProvider.php | 4 +- .../BootableServiceProviderInterface.php | 2 +- .../ServiceProviderAggregate.php | 8 +- .../ServiceProviderAggregateInterface.php | 4 +- .../ServiceProviderInterface.php | 4 +- phpcs.xml | 1 + .../AbstractServiceProvider.php | 7 +- .../DependencyManagement/Definition.php | 2 +- .../ExtendedContainer.php | 4 +- src/Internal/Vendor/README.md | 45 ----- src/Vendor/.gitignore | 5 + src/Vendor/README.md | 7 + .../AbstractServiceProviderTest.php | 2 +- 45 files changed, 566 insertions(+), 210 deletions(-) rename bin/{move-vendor-packages.sh => build-lib.sh} (55%) create mode 100644 lib/README.md create mode 100644 lib/composer.json create mode 100644 lib/composer.lock rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/ArgumentResolverInterface.php (80%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/ArgumentResolverTrait.php (90%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/ClassName.php (84%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/ClassNameInterface.php (70%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/ClassNameWithOptionalValue.php (89%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/RawArgument.php (84%) rename {src/Internal/Vendor => lib/packages}/League/Container/Argument/RawArgumentInterface.php (71%) rename {src/Internal/Vendor => lib/packages}/League/Container/Container.php (92%) rename {src/Internal/Vendor => lib/packages}/League/Container/ContainerAwareInterface.php (93%) rename {src/Internal/Vendor => lib/packages}/League/Container/ContainerAwareTrait.php (90%) rename {src/Internal/Vendor => lib/packages}/League/Container/Definition/Definition.php (95%) rename {src/Internal/Vendor => lib/packages}/League/Container/Definition/DefinitionAggregate.php (91%) rename {src/Internal/Vendor => lib/packages}/League/Container/Definition/DefinitionAggregateInterface.php (89%) rename {src/Internal/Vendor => lib/packages}/League/Container/Definition/DefinitionInterface.php (93%) rename {src/Internal/Vendor => lib/packages}/League/Container/Exception/ContainerException.php (68%) rename {src/Internal/Vendor => lib/packages}/League/Container/Exception/NotFoundException.php (70%) rename {src/Internal/Vendor => lib/packages}/League/Container/Inflector/Inflector.php (87%) rename {src/Internal/Vendor => lib/packages}/League/Container/Inflector/InflectorAggregate.php (87%) rename {src/Internal/Vendor => lib/packages}/League/Container/Inflector/InflectorAggregateInterface.php (77%) rename {src/Internal/Vendor => lib/packages}/League/Container/Inflector/InflectorInterface.php (94%) rename {src/Internal/Vendor => lib/packages}/League/Container/ReflectionContainer.php (91%) rename {src/Internal/Vendor => lib/packages}/League/Container/ServiceProvider/AbstractServiceProvider.php (82%) rename {src/Internal/Vendor => lib/packages}/League/Container/ServiceProvider/BootableServiceProviderInterface.php (80%) rename {src/Internal/Vendor => lib/packages}/League/Container/ServiceProvider/ServiceProviderAggregate.php (86%) rename {src/Internal/Vendor => lib/packages}/League/Container/ServiceProvider/ServiceProviderAggregateInterface.php (82%) rename {src/Internal/Vendor => lib/packages}/League/Container/ServiceProvider/ServiceProviderInterface.php (87%) delete mode 100644 src/Internal/Vendor/README.md create mode 100644 src/Vendor/.gitignore create mode 100644 src/Vendor/README.md diff --git a/.gitignore b/.gitignore index b396e534b34..c1723b0345e 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,8 @@ tests/cli/vendor # Composer /vendor/ -/bin/composer/**/vendor +/bin/composer/**/vendor/ +/lib/vendor/ contributors.md contributors.html diff --git a/bin/move-vendor-packages.sh b/bin/build-lib.sh similarity index 55% rename from bin/move-vendor-packages.sh rename to bin/build-lib.sh index 40f06127800..19e6acb9cbb 100755 --- a/bin/move-vendor-packages.sh +++ b/bin/build-lib.sh @@ -20,14 +20,16 @@ if [ -z "$(php -r "echo version_compare(PHP_VERSION,'7.2','>=');")" ]; then exit 1 fi -output 6 "Moving the appropriate vendor packages to Automattic\WooCommerce\Internal\Vendor" +output 6 "Building lib package" -# Delete the entire contents of src/Internal/Vendor, except README.md -find src/Internal/Vendor/* ! -name README.md -prune -exec rm -rf {} + +# Clean the output directories to remove any files not present anymore +rm -rf lib/packages lib/classes +mkdir lib/packages lib/classes -# Move the appropriate vendor packages to src/Internal/Vendor -# (see extra/mozart for configuration) -./vendor/bin/mozart compose || exit "$?" +# Running update on the lib package will automatically run Mozart +pushd ./lib +composer update +popd output 6 "Updating autoload files" diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index 10b7d6a0ec7..cf2baa492df 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -32,6 +32,7 @@ "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, + "default-branch": true, "bin": [ "bin/mozart" ], @@ -52,6 +53,10 @@ } ], "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/master" + }, "funding": [ { "url": "https://github.com/coenjacobs", @@ -142,6 +147,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.0.70" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -197,6 +206,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -269,6 +282,9 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v4.4.16" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -327,6 +343,9 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v4.4.16" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -404,6 +423,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -480,6 +502,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -560,6 +585,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -636,6 +664,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -665,5 +696,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 9eee228d3be..363928fcb9a 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -71,6 +71,10 @@ "stylecheck", "tests" ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -129,6 +133,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -181,6 +189,10 @@ "polyfill", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, "time": "2019-11-04T15:17:54+00:00" }, { @@ -231,6 +243,10 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, "time": "2019-08-28T14:22:28+00:00" }, { @@ -282,6 +298,11 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2020-10-23T02:01:07+00:00" }, { @@ -322,6 +343,10 @@ "woocommerce", "wordpress" ], + "support": { + "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", + "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master" + }, "time": "2020-08-06T18:23:45+00:00" }, { @@ -368,6 +393,11 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -381,5 +411,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index c39e74f0ed9..3d4ddb93b9f 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -332,6 +332,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -444,6 +448,10 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -604,6 +612,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -908,6 +920,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + }, "time": "2017-03-04T06:30:41+00:00" }, { @@ -1153,6 +1169,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "time": "2019-09-14T09:02:43+00:00" }, { @@ -1204,6 +1224,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1251,6 +1275,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + }, "time": "2017-08-03T12:35:26+00:00" }, { @@ -1296,6 +1324,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + }, "time": "2017-03-29T09:07:27+00:00" }, { @@ -1349,6 +1381,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, "time": "2017-03-03T06:23:57+00:00" }, { @@ -1438,6 +1474,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -1557,6 +1597,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -1606,6 +1650,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1619,5 +1667,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index 13d55f66c0a..9d610856bc0 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -67,6 +67,11 @@ "po", "translation" ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Gettext/issues", + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.2" + }, "time": "2019-12-02T10:21:14+00:00" }, { @@ -128,6 +133,10 @@ "translations", "unicode" ], + "support": { + "issues": "https://github.com/php-gettext/Languages/issues", + "source": "https://github.com/php-gettext/Languages/tree/2.6.0" + }, "time": "2019-11-13T10:30:21+00:00" }, { @@ -173,6 +182,10 @@ } ], "description": "Peast is PHP library that generates AST for JavaScript code", + "support": { + "issues": "https://github.com/mck89/peast/issues", + "source": "https://github.com/mck89/peast/tree/v1.11.0" + }, "time": "2020-10-09T15:12:13+00:00" }, { @@ -219,6 +232,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/master" + }, "time": "2019-11-23T21:40:31+00:00" }, { @@ -268,6 +285,10 @@ "iri", "sockets" ], + "support": { + "issues": "https://github.com/rmccue/Requests/issues", + "source": "https://github.com/rmccue/Requests/tree/master" + }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -377,6 +398,10 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", + "support": { + "issues": "https://github.com/wp-cli/i18n-command/issues", + "source": "https://github.com/wp-cli/i18n-command/tree/master" + }, "time": "2020-07-08T15:20:38+00:00" }, { @@ -425,6 +450,9 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -475,6 +503,10 @@ "cli", "console" ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/master" + }, "time": "2018-09-04T13:28:00+00:00" }, { @@ -537,6 +569,11 @@ "cli", "wordpress" ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, "time": "2020-02-18T08:15:37+00:00" } ], @@ -550,5 +587,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/composer.json b/composer.json index f41446b1785..96f8467e83b 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,12 @@ "license": "GPL-3.0-or-later", "prefer-stable": true, "minimum-stability": "dev", + "repositories": [ + { + "type": "path", + "url": "lib" + } + ], "require": { "php": ">=7.0", "automattic/jetpack-autoloader": "2.2.0", @@ -17,11 +23,10 @@ "woocommerce/action-scheduler": "3.1.6", "woocommerce/woocommerce-admin": "1.7.0", "woocommerce/woocommerce-blocks": "3.8.0", - "league/container": "3.3.3" + "woocommerce/woocommerce-lib": "@dev" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "league/container": "3.3.3" + "bamarni/composer-bin-plugin": "^1.4" }, "config": { "platform": { @@ -85,8 +90,8 @@ "bin": [ "echo 'bin not installed'" ], - "move-vendor-packages": [ - "sh ./bin/move-vendor-packages.sh" + "build-lib": [ + "sh ./bin/build-lib.sh" ] }, "extra": { @@ -106,19 +111,6 @@ }, "bamarni-bin": { "target-directory": "bin/composer" - }, - "mozart": { - "dep_namespace": "Automattic\\WooCommerce\\Internal\\Vendor\\", - "dep_directory": "/src/Internal/Vendor/", - "packages": [ - "league/container" - ], - "excluded_packages": [ - "psr/container" - ], - "classmap_directory": "/classmaps", - "classmap_prefix": "WOO_", - "delete_vendor_directories": true } } } diff --git a/composer.lock b/composer.lock index b77c6986064..cdba0b3a917 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0373a0a4d2df08885d048edab884822b", + "content-hash": "cf86e77a0dae2549e3e8060ae85f8af7", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -40,6 +40,9 @@ "GPL-2.0-or-later" ], "description": "Creates a custom autoloader for a plugin or theme.", + "support": { + "source": "https://github.com/Automattic/jetpack-autoloader/tree/master" + }, "time": "2020-08-14T20:34:36+00:00" }, { @@ -71,6 +74,9 @@ "GPL-2.0-or-later" ], "description": "A wrapper for defining constants in a more testable way.", + "support": { + "source": "https://github.com/Automattic/jetpack-constants/tree/master" + }, "time": "2020-08-13T14:33:09+00:00" }, { @@ -214,78 +220,6 @@ ], "time": "2020-04-07T06:57:05+00:00" }, - { - "name": "league/container", - "version": "3.3.3", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/container.git", - "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05", - "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/container": "^1.0" - }, - "provide": { - "psr/container-implementation": "^1.0" - }, - "replace": { - "orno/di": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Container\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Phil Bennett", - "email": "philipobenito@gmail.com", - "homepage": "http://www.philipobenito.com", - "role": "Developer" - } - ], - "description": "A fast and intuitive dependency injection container.", - "homepage": "https://github.com/thephpleague/container", - "keywords": [ - "container", - "dependency", - "di", - "injection", - "league", - "provider", - "service" - ], - "funding": [ - { - "url": "https://github.com/philipobenito", - "type": "github" - } - ], - "time": "2020-09-28T13:38:44+00:00" - }, { "name": "maxmind-db/reader", "version": "v1.6.0", @@ -344,6 +278,10 @@ "geolocation", "maxmind" ], + "support": { + "issues": "https://github.com/maxmind/MaxMind-DB-Reader-php/issues", + "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.6.0" + }, "time": "2019-12-19T22:59:03+00:00" }, { @@ -418,6 +356,10 @@ "email", "pre-processing" ], + "support": { + "issues": "https://github.com/MyIntervals/emogrifier/issues", + "source": "https://github.com/MyIntervals/emogrifier" + }, "time": "2019-12-26T19:37:31+00:00" }, { @@ -467,6 +409,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -558,6 +504,10 @@ ], "description": "Action Scheduler for WordPress and WooCommerce", "homepage": "https://actionscheduler.org/", + "support": { + "issues": "https://github.com/woocommerce/action-scheduler/issues", + "source": "https://github.com/woocommerce/action-scheduler/tree/master" + }, "time": "2020-05-12T16:22:33+00:00" }, { @@ -659,6 +609,60 @@ "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.0" }, "time": "2020-11-10T15:07:11+00:00" + }, + { + "name": "woocommerce/woocommerce-lib", + "version": "dev-use-mozart-to-renamespace-dependencies", + "dist": { + "type": "path", + "url": "lib", + "reference": "d9d4733f0ed94289ad50fdf98cb4bc028384f482" + }, + "require": { + "php": ">=7.0", + "psr/container": "^1.0" + }, + "require-dev": { + "league/container": "3.3.3" + }, + "type": "library", + "extra": { + "mozart": { + "dep_namespace": "Automattic\\WooCommerce\\Vendor\\", + "dep_directory": "/packages/", + "packages": [ + "league/container" + ], + "excluded_packages": [ + "psr/container" + ], + "classmap_directory": "/classes/", + "classmap_prefix": "WC_", + "delete_vendor_directories": false + } + }, + "autoload": { + "psr-4": { + "Automattic\\WooCommerce\\Vendor\\": "packages/" + }, + "psr-0": { + "Automattic\\WooCommerce\\Vendor\\": "packages/" + } + }, + "scripts": { + "post-install-cmd": [ + "\"../vendor/bin/mozart\" compose", + "composer dump-autoload" + ], + "post-update-cmd": [ + "\"../vendor/bin/mozart\" compose", + "composer dump-autoload" + ] + }, + "description": "A package for hiding re-namespaced dependencies and executing them", + "transport-options": { + "relative": true + } } ], "packages-dev": [ @@ -706,12 +710,18 @@ "isolation", "tool" ], + "support": { + "issues": "https://github.com/bamarni/composer-bin-plugin/issues", + "source": "https://github.com/bamarni/composer-bin-plugin/tree/master" + }, "time": "2020-05-03T08:27:20+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "woocommerce/woocommerce-lib": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { @@ -721,5 +731,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 00000000000..543b5e4bd96 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,31 @@ +## WooCommerce Lib Directory + +This directory contains a dummy package responsible for managing WooCommerce dependencies that require conflict avoidance. +The contents of the `packages` and `classes` directories get automatically generated by `composer install` and `composer update`. + +This allows us to prefix namespaces and classmap classes to avoid conflicts with plugins that include the same package. +All namespaces are prefixed with `Automattic\WooCommerce\Vendor` and classmap classes prefixed with `WC_Vendor_`. + +**_Do not_ make direct changes in the files contained in `packages` or `classes`! Any changes will be lost!** + +### Adding Packages + +In order to avoid including the original dependencies in the root autoloader we must utilize `require-dev` for them. +Composer treats `require` dependencies as transitive while `require-dev` dependencies get ignored by consumers. + +1. Add package to `require-dev` section of `composer.json` +2. Add package slug to `extra/mozart/packages` section of `composer.json` +3. Run `composer run-script build-lib` from the root directory (You should now see the package in `packages/VendorName/PackageName` or `classes`) + +### Updating Packages + +Updating a package is as easy as changing the version in `composer.json` and then running `composer run-script build-lib` from the root directory. + +### Ignoring Packages + +If you would like to add a package which does not undergo conflict avoidance you must take steps to ensure it appears in +the root autoloader. + +1. Add package to `require` instead of `require-dev` (This allows it to be pulled transitively) +2. Add package slug to `extra/mozart/excluded-packages` section of `composer.json` +3. Run `composer run-script build-lib` from the root directory (You **should not** see the package in `packages/VendorName/PackageName` or `classes`) diff --git a/lib/composer.json b/lib/composer.json new file mode 100644 index 00000000000..2970eb74f92 --- /dev/null +++ b/lib/composer.json @@ -0,0 +1,51 @@ +{ + "name": "woocommerce/woocommerce-lib", + "description": "A package for hiding re-namespaced dependencies and executing them", + "prefer-stable": true, + "minimum-stability": "dev", + "require": { + "php": ">=7.0", + "psr/container": "^1.0" + }, + "require-dev": { + "league/container": "3.3.3" + }, + "autoload": { + "psr-4": { + "Automattic\\WooCommerce\\Vendor\\": "packages/" + }, + "psr-0": { + "Automattic\\WooCommerce\\Vendor\\": "packages/" + } + }, + "config": { + "platform": { + "php": "7.0" + } + }, + "scripts": { + "post-install-cmd": [ + "\"../vendor/bin/mozart\" compose", + "composer dump-autoload" + ], + "post-update-cmd": [ + "\"../vendor/bin/mozart\" compose", + "composer dump-autoload" + ] + }, + "extra": { + "mozart": { + "dep_namespace": "Automattic\\WooCommerce\\Vendor\\", + "dep_directory": "/packages/", + "packages": [ + "league/container" + ], + "excluded_packages": [ + "psr/container" + ], + "classmap_directory": "/classes/", + "classmap_prefix": "WC_Vendor_", + "delete_vendor_directories": false + } + } +} diff --git a/lib/composer.lock b/lib/composer.lock new file mode 100644 index 00000000000..f24c69c33ed --- /dev/null +++ b/lib/composer.lock @@ -0,0 +1,154 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "998898140bfcf00b7d3a9b793ecfba72", + "packages": [ + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "time": "2017-02-14T16:28:37+00:00" + } + ], + "packages-dev": [ + { + "name": "league/container", + "version": "3.3.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/7dc67bdf89efc338e674863c0ea70a63efe4de05", + "reference": "7dc67bdf89efc338e674863c0ea70a63efe4de05", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "^1.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://www.philipobenito.com", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "support": { + "issues": "https://github.com/thephpleague/container/issues", + "source": "https://github.com/thephpleague/container/tree/3.3.3" + }, + "funding": [ + { + "url": "https://github.com/philipobenito", + "type": "github" + } + ], + "time": "2020-09-28T13:38:44+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.0" + }, + "plugin-api-version": "2.0.0" +} diff --git a/src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php b/lib/packages/League/Container/Argument/ArgumentResolverInterface.php similarity index 80% rename from src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php rename to lib/packages/League/Container/Argument/ArgumentResolverInterface.php index 82744c31f91..9c7393f6578 100644 --- a/src/Internal/Vendor/League/Container/Argument/ArgumentResolverInterface.php +++ b/lib/packages/League/Container/Argument/ArgumentResolverInterface.php @@ -1,8 +1,8 @@ includes/wc-deprecated-functions.php */node_modules/* */vendor/* + lib/ diff --git a/src/Internal/DependencyManagement/AbstractServiceProvider.php b/src/Internal/DependencyManagement/AbstractServiceProvider.php index 128ceaa9e79..bc35e90b37c 100644 --- a/src/Internal/DependencyManagement/AbstractServiceProvider.php +++ b/src/Internal/DependencyManagement/AbstractServiceProvider.php @@ -5,8 +5,9 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Argument\RawArgument; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Vendor\League\Container\Argument\RawArgument; +use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\AbstractServiceProvider as BaseServiceProvider; /** * Base class for the service providers used to register classes in the container. @@ -18,7 +19,7 @@ use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\Definitio * - The `share_with_auto_arguments` method, sibling of the above. * - Convenience `add` and `share` methods that are just proxies for the same methods in `$this->getContainer()`. */ -abstract class AbstractServiceProvider extends \Automattic\WooCommerce\Internal\Vendor\League\Container\ServiceProvider\AbstractServiceProvider { +abstract class AbstractServiceProvider extends BaseServiceProvider { /** * Register a class in the container and use reflection to guess the injection method arguments. diff --git a/src/Internal/DependencyManagement/Definition.php b/src/Internal/DependencyManagement/Definition.php index b4248fd49c1..5ed07283749 100644 --- a/src/Internal/DependencyManagement/Definition.php +++ b/src/Internal/DependencyManagement/Definition.php @@ -5,7 +5,7 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\Definition as BaseDefinition; +use Automattic\WooCommerce\Vendor\League\Container\Definition\Definition as BaseDefinition; /** * An extension of the definition class that replaces constructor injection with method injection. diff --git a/src/Internal/DependencyManagement/ExtendedContainer.php b/src/Internal/DependencyManagement/ExtendedContainer.php index 59bd25dee87..a4e084cf76a 100644 --- a/src/Internal/DependencyManagement/ExtendedContainer.php +++ b/src/Internal/DependencyManagement/ExtendedContainer.php @@ -6,8 +6,8 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement; use Automattic\WooCommerce\Utilities\StringUtil; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Container as BaseContainer; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Vendor\League\Container\Container as BaseContainer; +use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; /** * This class extends the original League's Container object by adding some functionality diff --git a/src/Internal/Vendor/README.md b/src/Internal/Vendor/README.md deleted file mode 100644 index 107994346a0..00000000000 --- a/src/Internal/Vendor/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## Vendor files directory - -The contents of this directory are automatically generated by moving some of the packages in the `vendor` directory and prefixing the namespace of their classes with `Automattic\WooCommerce\Internal\Vendor`, right after `composer install/update` finishes. This is done to prevent conflicts with plugins using the same packages. - -**Do no** make manual changes in the files here. Such changes will be lost the next time the contents are regenerated. - -### Registering packages to be moved - -If you want to register a vendor package for being moved to the `Automattic\WooCommerce\Internal\Vendor` namespace in order to avoid possible namespace conflicts, follow these steps: - -1. Add the package to the `require-dev` section in `composer.json`. If the package was already listed in `require`, remove it. - -2. Add the package to the `extra/mozart/packages` section in `composer.json` too, note that this time you add only the package slug (not the version). - -3. Run `composer update`. - -4. Run `composer run move-vendor-packages`. - -5. Notice that a new folder `VendorName/PackageName` has been added to `src/Internal/Vendor`. Add it to source control. - -6. All the namespaces in the moved code will have been prefixed with `Automattic\WooCommerce\Internal\Vendor`, so if you already had code that made use of the package, you'll need to adjust it accordingly. - -The `composer run move-vendor-packages` command uses the [coenjacobs/mozart](https://github.com/coenjacobs/mozart) package, which requires PHP 7.2 or newer. - -### Updating packages - -If you want to update any of the moved packages to a new version, repeat steps 3 to 5 above. - -### Preventing a dependency from being moved - -If you want to prevent a package dependency from being moved and thus re-namespaced (for example, we use a moved `league/container` package but it has a dependency on `psr/container` which we don't want to be moved) you need to follow these additional steps after 2 above: - -2.1. Add the dependency to the `require` section in `composer.json`. Yes, this time it's `require`, not `require-dev`. - -2.2. Add the dependency to the `extra/mozart/excluded-packages` section in `composer.json` too (again, the slug only). - -### Why adding the packages to be moved to require-dev? - -Once a package has been moved it's no longer needed in the `vendor` directory, so we don't want it to be there when we build WooCommerce into a zip file (we want that zip file to be as small as possible). - -Fortunately, the `npm run build` command executes `composer install --no-dev` before generating the zip file. Therefore, by adding the package to `require-dev` we make sure that the package will not be present in the `vendor` directory in the generated zip. - -The package will still be in `vendor` when you run `composer update/install` in your development environment, but you are free to just ignore it. Note that `composer run move-vendor-packages` will effectively remove the package from `vendor`, but that's not a command you will normally need to run. - - diff --git a/src/Vendor/.gitignore b/src/Vendor/.gitignore new file mode 100644 index 00000000000..ef7b2901fa6 --- /dev/null +++ b/src/Vendor/.gitignore @@ -0,0 +1,5 @@ +# Prevent anyone from accidentally adding code to these directories. +# This will break any PRs that do, revealing ths mistake they made. +README.md +!.gitignore +!README.md diff --git a/src/Vendor/README.md b/src/Vendor/README.md new file mode 100644 index 00000000000..ae39d3e4e8b --- /dev/null +++ b/src/Vendor/README.md @@ -0,0 +1,7 @@ +# WARNING + +The namespace of this folder belongs to our dummy [lib package](./../lib/README.md) to manage conflict avoidance. +No files should be added here! + +These are **internal** dependencies and **should not** be considered backwards compatible! Developers should not +use these files outside of WooCommerce Core as they are subject to change. diff --git a/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php b/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php index acc6ba81b83..beaa70dcef8 100644 --- a/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php +++ b/tests/php/src/Internal/DependencyManagement/AbstractServiceProviderTest.php @@ -15,7 +15,7 @@ use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\Cl use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithPrivateInjectionMethod; use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\ClassWithScalarInjectionMethodArgument; use Automattic\WooCommerce\Tests\Internal\DependencyManagement\ExampleClasses\DependencyClass; -use Automattic\WooCommerce\Internal\Vendor\League\Container\Definition\DefinitionInterface; +use Automattic\WooCommerce\Vendor\League\Container\Definition\DefinitionInterface; /** * Tests for AbstractServiceProvider. From e9dfe64f9f28a236ecf04e052c19bbc59d887394 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 18 Nov 2020 15:31:54 -0800 Subject: [PATCH 31/82] Replaced the local repository with root autoload definitions Since Composer can't recursively use repositories, we can't actually use a local package to deal with this. We're going to keep the local package to separate the dependencies but we need to add autoload keys in the root package's `composer.json` --- bin/composer/wp/composer.lock | 12 +++---- composer.json | 9 ++++-- composer.lock | 60 ++--------------------------------- lib/README.md | 2 +- lib/composer.json | 16 ++-------- lib/composer.lock | 2 +- 6 files changed, 19 insertions(+), 82 deletions(-) diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index 9d610856bc0..d1cea76fbfc 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -9,16 +9,16 @@ "packages-dev": [ { "name": "gettext/gettext", - "version": "v4.8.2", + "version": "v4.8.3", "source": { "type": "git", "url": "https://github.com/php-gettext/Gettext.git", - "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a" + "reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/e474f872f2c8636cf53fd283ec4ce1218f3d236a", - "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/57ff4fb16647e78e80a5909fe3c190f1c3110321", + "reference": "57ff4fb16647e78e80a5909fe3c190f1c3110321", "shasum": "" }, "require": { @@ -70,9 +70,9 @@ "support": { "email": "oom@oscarotero.com", "issues": "https://github.com/oscarotero/Gettext/issues", - "source": "https://github.com/php-gettext/Gettext/tree/v4.8.2" + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.3" }, - "time": "2019-12-02T10:21:14+00:00" + "time": "2020-11-18T22:35:49+00:00" }, { "name": "gettext/languages", diff --git a/composer.json b/composer.json index 96f8467e83b..118a12762b2 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", "woocommerce/woocommerce-admin": "1.7.0", - "woocommerce/woocommerce-blocks": "3.8.0", - "woocommerce/woocommerce-lib": "@dev" + "woocommerce/woocommerce-blocks": "3.8.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4" @@ -54,7 +53,11 @@ "autoload-dev": { "psr-4": { "Automattic\\WooCommerce\\Tests\\": "tests/php/src/", - "Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools/" + "Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools/", + "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" + }, + "psr-0": { + "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" }, "classmap": [ "tests/legacy/unit-tests/rest-api/Helpers" diff --git a/composer.lock b/composer.lock index cdba0b3a917..cc7487aaa34 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cf86e77a0dae2549e3e8060ae85f8af7", + "content-hash": "ddeda3843bbb8fd35abf1cea951c47df", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -609,60 +609,6 @@ "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.0" }, "time": "2020-11-10T15:07:11+00:00" - }, - { - "name": "woocommerce/woocommerce-lib", - "version": "dev-use-mozart-to-renamespace-dependencies", - "dist": { - "type": "path", - "url": "lib", - "reference": "d9d4733f0ed94289ad50fdf98cb4bc028384f482" - }, - "require": { - "php": ">=7.0", - "psr/container": "^1.0" - }, - "require-dev": { - "league/container": "3.3.3" - }, - "type": "library", - "extra": { - "mozart": { - "dep_namespace": "Automattic\\WooCommerce\\Vendor\\", - "dep_directory": "/packages/", - "packages": [ - "league/container" - ], - "excluded_packages": [ - "psr/container" - ], - "classmap_directory": "/classes/", - "classmap_prefix": "WC_", - "delete_vendor_directories": false - } - }, - "autoload": { - "psr-4": { - "Automattic\\WooCommerce\\Vendor\\": "packages/" - }, - "psr-0": { - "Automattic\\WooCommerce\\Vendor\\": "packages/" - } - }, - "scripts": { - "post-install-cmd": [ - "\"../vendor/bin/mozart\" compose", - "composer dump-autoload" - ], - "post-update-cmd": [ - "\"../vendor/bin/mozart\" compose", - "composer dump-autoload" - ] - }, - "description": "A package for hiding re-namespaced dependencies and executing them", - "transport-options": { - "relative": true - } } ], "packages-dev": [ @@ -719,9 +665,7 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "woocommerce/woocommerce-lib": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/lib/README.md b/lib/README.md index 543b5e4bd96..7119d5574bd 100644 --- a/lib/README.md +++ b/lib/README.md @@ -26,6 +26,6 @@ Updating a package is as easy as changing the version in `composer.json` and the If you would like to add a package which does not undergo conflict avoidance you must take steps to ensure it appears in the root autoloader. -1. Add package to `require` instead of `require-dev` (This allows it to be pulled transitively) +1. Add package to the `require` section of both the `lib/composer.json` and root `composer.json` file instead of `require-dev` 2. Add package slug to `extra/mozart/excluded-packages` section of `composer.json` 3. Run `composer run-script build-lib` from the root directory (You **should not** see the package in `packages/VendorName/PackageName` or `classes`) diff --git a/lib/composer.json b/lib/composer.json index 2970eb74f92..7e9e4481f95 100644 --- a/lib/composer.json +++ b/lib/composer.json @@ -10,14 +10,6 @@ "require-dev": { "league/container": "3.3.3" }, - "autoload": { - "psr-4": { - "Automattic\\WooCommerce\\Vendor\\": "packages/" - }, - "psr-0": { - "Automattic\\WooCommerce\\Vendor\\": "packages/" - } - }, "config": { "platform": { "php": "7.0" @@ -25,12 +17,10 @@ }, "scripts": { "post-install-cmd": [ - "\"../vendor/bin/mozart\" compose", - "composer dump-autoload" + "\"../vendor/bin/mozart\" compose" ], "post-update-cmd": [ - "\"../vendor/bin/mozart\" compose", - "composer dump-autoload" + "\"../vendor/bin/mozart\" compose" ] }, "extra": { @@ -45,7 +35,7 @@ ], "classmap_directory": "/classes/", "classmap_prefix": "WC_Vendor_", - "delete_vendor_directories": false + "delete_vendor_directories": true } } } diff --git a/lib/composer.lock b/lib/composer.lock index f24c69c33ed..7484f6c2635 100644 --- a/lib/composer.lock +++ b/lib/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "998898140bfcf00b7d3a9b793ecfba72", + "content-hash": "df548645b5c00d585705cd10c6ffd3f7", "packages": [ { "name": "psr/container", From 591491dd4c7de4b55218a334f8ef6f8111698a9c Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 18 Nov 2020 15:38:05 -0800 Subject: [PATCH 32/82] Fixed the broken vendor autoloads --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 118a12762b2..d2375ddd79f 100644 --- a/composer.json +++ b/composer.json @@ -47,17 +47,17 @@ "includes/rest-api" ], "psr-4": { - "Automattic\\WooCommerce\\": "src/" + "Automattic\\WooCommerce\\": "src/", + "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" + }, + "psr-0": { + "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" } }, "autoload-dev": { "psr-4": { "Automattic\\WooCommerce\\Tests\\": "tests/php/src/", - "Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools/", - "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" - }, - "psr-0": { - "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" + "Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools/" }, "classmap": [ "tests/legacy/unit-tests/rest-api/Helpers" From 16bd67688fc470a62d09f4e6882d37ca6330be59 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Thu, 19 Nov 2020 09:25:48 +0100 Subject: [PATCH 33/82] Remove "pushd" and "popd" from build-lib.sh These are bash specific commands and will fail since the script is actually run as a sh script. Instead, the "-d" option of composer is now used. --- bin/build-lib.sh | 4 +-- bin/composer/mozart/composer.lock | 3 +- bin/composer/phpcs/composer.lock | 32 +------------------ bin/composer/phpunit/composer.lock | 50 +----------------------------- bin/composer/wp/composer.lock | 34 +------------------- composer.lock | 2 +- lib/composer.lock | 10 +----- 7 files changed, 7 insertions(+), 128 deletions(-) diff --git a/bin/build-lib.sh b/bin/build-lib.sh index 19e6acb9cbb..d4e73015af2 100755 --- a/bin/build-lib.sh +++ b/bin/build-lib.sh @@ -27,9 +27,7 @@ rm -rf lib/packages lib/classes mkdir lib/packages lib/classes # Running update on the lib package will automatically run Mozart -pushd ./lib -composer update -popd +composer update -d ./lib output 6 "Updating autoload files" diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index cf2baa492df..beb86eb0013 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -32,7 +32,6 @@ "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, - "default-branch": true, "bin": [ "bin/mozart" ], @@ -696,5 +695,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 363928fcb9a..9eee228d3be 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -71,10 +71,6 @@ "stylecheck", "tests" ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -133,10 +129,6 @@ "phpcs", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -189,10 +181,6 @@ "polyfill", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, "time": "2019-11-04T15:17:54+00:00" }, { @@ -243,10 +231,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, "time": "2019-08-28T14:22:28+00:00" }, { @@ -298,11 +282,6 @@ "phpcs", "standards" ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, "time": "2020-10-23T02:01:07+00:00" }, { @@ -343,10 +322,6 @@ "woocommerce", "wordpress" ], - "support": { - "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", - "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master" - }, "time": "2020-08-06T18:23:45+00:00" }, { @@ -393,11 +368,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -411,5 +381,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index 3d4ddb93b9f..c39e74f0ed9 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -332,10 +332,6 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" - }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -448,10 +444,6 @@ "spy", "stub" ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -612,10 +604,6 @@ "keywords": [ "template" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -920,10 +908,6 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" - }, "time": "2017-03-04T06:30:41+00:00" }, { @@ -1169,10 +1153,6 @@ "export", "exporter" ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, "time": "2019-09-14T09:02:43+00:00" }, { @@ -1224,10 +1204,6 @@ "keywords": [ "global state" ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" - }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1275,10 +1251,6 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" - }, "time": "2017-08-03T12:35:26+00:00" }, { @@ -1324,10 +1296,6 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" - }, "time": "2017-03-29T09:07:27+00:00" }, { @@ -1381,10 +1349,6 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, "time": "2017-03-03T06:23:57+00:00" }, { @@ -1474,10 +1438,6 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -1597,10 +1557,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" - }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -1650,10 +1606,6 @@ "check", "validate" ], - "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1667,5 +1619,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index d1cea76fbfc..e081be14315 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -133,10 +133,6 @@ "translations", "unicode" ], - "support": { - "issues": "https://github.com/php-gettext/Languages/issues", - "source": "https://github.com/php-gettext/Languages/tree/2.6.0" - }, "time": "2019-11-13T10:30:21+00:00" }, { @@ -182,10 +178,6 @@ } ], "description": "Peast is PHP library that generates AST for JavaScript code", - "support": { - "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.11.0" - }, "time": "2020-10-09T15:12:13+00:00" }, { @@ -232,10 +224,6 @@ "mustache", "templating" ], - "support": { - "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/master" - }, "time": "2019-11-23T21:40:31+00:00" }, { @@ -285,10 +273,6 @@ "iri", "sockets" ], - "support": { - "issues": "https://github.com/rmccue/Requests/issues", - "source": "https://github.com/rmccue/Requests/tree/master" - }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -398,10 +382,6 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", - "support": { - "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/master" - }, "time": "2020-07-08T15:20:38+00:00" }, { @@ -450,9 +430,6 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", - "support": { - "source": "https://github.com/wp-cli/spyc/tree/autoload" - }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -503,10 +480,6 @@ "cli", "console" ], - "support": { - "issues": "https://github.com/wp-cli/php-cli-tools/issues", - "source": "https://github.com/wp-cli/php-cli-tools/tree/master" - }, "time": "2018-09-04T13:28:00+00:00" }, { @@ -569,11 +542,6 @@ "cli", "wordpress" ], - "support": { - "docs": "https://make.wordpress.org/cli/handbook/", - "issues": "https://github.com/wp-cli/wp-cli/issues", - "source": "https://github.com/wp-cli/wp-cli" - }, "time": "2020-02-18T08:15:37+00:00" } ], @@ -587,5 +555,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/composer.lock b/composer.lock index cc7487aaa34..2440ade2902 100644 --- a/composer.lock +++ b/composer.lock @@ -675,5 +675,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/lib/composer.lock b/lib/composer.lock index 7484f6c2635..ac31c819004 100644 --- a/lib/composer.lock +++ b/lib/composer.lock @@ -53,10 +53,6 @@ "container-interop", "psr" ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, "time": "2017-02-14T16:28:37+00:00" } ], @@ -125,10 +121,6 @@ "provider", "service" ], - "support": { - "issues": "https://github.com/thephpleague/container/issues", - "source": "https://github.com/thephpleague/container/tree/3.3.3" - }, "funding": [ { "url": "https://github.com/philipobenito", @@ -150,5 +142,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } From 5f14472e5a9e4a3474897cc149dd87126d476d65 Mon Sep 17 00:00:00 2001 From: Mathias De Beyser Date: Thu, 19 Nov 2020 21:29:57 +0100 Subject: [PATCH 34/82] Update wc-formatting-functions.php Issue When changing the "low stock amount" on product level, a.k.a. setting a "low stock amount" for a specific product. The message on the single product page does not change from "%s in stock" to "Only %s left in stock". It only checks the global setting "low stock quantity" defined in WooCommerce > Products > Stock. --- includes/wc-formatting-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index 46434075850..e784db14613 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -1190,7 +1190,7 @@ function wc_format_stock_for_display( $product ) { switch ( get_option( 'woocommerce_stock_format' ) ) { case 'low_amount': - if ( $stock_amount <= get_option( 'woocommerce_notify_low_stock_amount' ) ) { + if ( $stock_amount <= wc_get_low_stock_amount( $product ) ) { /* translators: %s: stock amount */ $display = sprintf( __( 'Only %s left in stock', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_amount, $product ) ); } From 673b50b4fd2de8a50adab58536353fb3bddfcd55 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 19 Nov 2020 11:55:39 -0300 Subject: [PATCH 35/82] Fix the layout of banner in the home page for the 2021 theme --- assets/css/twenty-twenty-one.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 1d86f162d8f..bc84710f356 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2432,6 +2432,16 @@ a.reset_variations { } } + /** + * Home page + */ + .home #main { + + .wp-block-cover { + max-width: none; + } + } + /** * Shop page */ From 31914b52d7cee0ccdd91b685b809c002eb4914e6 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 19 Nov 2020 11:58:48 -0300 Subject: [PATCH 36/82] Adjust font-weight of the section titles in the home page for the 2021 theme --- assets/css/twenty-twenty-one.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index bc84710f356..e80377b91ea 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -239,6 +239,10 @@ a.button { #main { + h2 { + font-weight: 500; + } + .woocommerce-error, .woocommerce-info { font-family: $headings; From aa2565b4d7deff82032ed648dc664924430232e5 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 19 Nov 2020 17:55:24 -0300 Subject: [PATCH 37/82] Start adjusting the product categories widget in the home page for the 2021 theme --- assets/css/twenty-twenty-one.scss | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index e80377b91ea..08f61243f42 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2121,7 +2121,7 @@ a.reset_variations { flex-direction: column; justify-content: space-between; align-items: flex-start; - margin-bottom: 5em; + margin: 0 8px 16px 8px; img.attachment-woocommerce_thumbnail { height: auto !important; @@ -2135,7 +2135,7 @@ a.reset_variations { h2.woocommerce-loop-category__title { font-family: $headings; - font-size: 3rem; + font-size: 20px; } } } @@ -2444,6 +2444,12 @@ a.reset_variations { .wp-block-cover { max-width: none; } + + [class*="woocommerce columns-"] { + max-width: var(--responsive--aligndefault-width); + margin-left: auto; + margin-right: auto; + } } /** From 089bb87314c629c56c3a5dd81504b0693281fc78 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 20 Nov 2020 14:48:18 -0400 Subject: [PATCH 38/82] clarify which WordPress nightly --- tests/e2e/docker/init-wp-beta.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/docker/init-wp-beta.sh b/tests/e2e/docker/init-wp-beta.sh index fedb3144884..6b44d74d0e6 100755 --- a/tests/e2e/docker/init-wp-beta.sh +++ b/tests/e2e/docker/init-wp-beta.sh @@ -9,7 +9,7 @@ wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=pas # we cannot create API keys for the API, so we using basic auth, this plugin allows that. wp plugin install https://github.com/WP-API/Basic-Auth/archive/master.zip --activate -echo "Updating to WordPress Nightly" +echo "Updating to WordPress Nightly Point Release" wp plugin install wordpress-beta-tester --activate wp core check-update From 313b2bd073eec7d8ee784a47037ae3878a07d5dc Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Mon, 23 Nov 2020 00:24:11 -0600 Subject: [PATCH 39/82] Update styling for homepage category --- assets/css/twenty-twenty-one.scss | 41 ++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 08f61243f42..96e8c078d9b 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2115,13 +2115,40 @@ a.reset_variations { align-items: stretch; flex-direction: row; flex-wrap: wrap; + box-sizing: border-box; + + &.columns-2 { + li.product { + width: 50% !important; + } + } + + &.columns-3 { + li.product { + width: 33.33% !important; + } + } + + &.columns-5 { + li.product { + width: 20% !important; + } + } + + &.columns-6 { + li.product { + width:16.66% !important; + } + } li.product { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; - margin: 0 8px 16px 8px; + padding: 0 8px 16px 8px !important; + margin: 0; + box-sizing: border-box; img.attachment-woocommerce_thumbnail { height: auto !important; @@ -2131,11 +2158,18 @@ a.reset_variations { li.product-category { a { - text-align: center; + text-align: left; + text-decoration: none; h2.woocommerce-loop-category__title { + margin-top: 0.4rem; font-family: $headings; - font-size: 20px; + font-size: 1rem; + + .count { + background-color: transparent; + color: $body-color; + } } } } @@ -2446,6 +2480,7 @@ a.reset_variations { } [class*="woocommerce columns-"] { + word-break: break-word; max-width: var(--responsive--aligndefault-width); margin-left: auto; margin-right: auto; From 08ec8d2547d719961cc96fd487963f93b89f4117 Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Mon, 23 Nov 2020 23:42:29 +0530 Subject: [PATCH 40/82] Style fixes for cart page for 2021 theme. --- assets/css/twenty-twenty-one.scss | 92 +++++++++++++++++++++++++++++++ includes/class-woocommerce.php | 3 - 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 1d86f162d8f..6b4f3851c52 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2608,3 +2608,95 @@ a.reset_variations { } } } + +.woocommerce { + .woocommerce-notices-wrapper { + & > * { + max-width: 47rem; + margin: auto; + background: var(--global--color-light-gray); + padding: 15px; + list-style: none; + } + } + + .woocommerce-cart-form { + .shop_table_responsive { + max-width: 46rem; + display: block; + margin: auto; + margin-top: var(--global--spacing-vertical); + margin-bottom: var(--global--spacing-vertical); + + th { + border: none; + } + + #coupon_code { + min-width: 9rem; + } + } + } + + .cart-collaterals { + margin: auto; + margin-top: var(--global--spacing-vertical); + margin-bottom: var(--global--spacing-vertical); + max-width: 92rem; + + h2 { + margin-bottom: var(--global--spacing-vertical); + } + + #shipping_method { + list-style: none; + padding-left: 0; + } + + .shipping-calculator-form { + + p { + margin-bottom: 0.5rem; + } + + .select2-container { + + .select2-selection { + height: auto; + } + + .select2-selection__rendered { + border: var(--form--border-width) solid var(--form--border-color); + border-radius: var(--form--border-radius); + color: var(--form--color-text); + height: var(--global--line-height-body); + padding: var(--form--spacing-unit); + } + + .select2-selection__arrow { + height: 100%; + } + } + } + + .wc-proceed-to-checkout { + + a.button { + margin-top: var(--global--spacing-vertical); + float: left; + } + } + + .cross-sells { + + li { + list-style: none; + } + + li > em, + a { + display: inline-block; + } + } + } +} diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index c5313fdbd63..a4059876149 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -530,9 +530,6 @@ final class WooCommerce { case 'twentytwenty': include_once WC_ABSPATH . 'includes/theme-support/class-wc-twenty-twenty.php'; break; - case 'twentytwentyone': - include_once WC_ABSPATH . 'includes/theme-support/class-wc-twenty-twenty-one.php'; - break; } } } From 528e7b7d91f8e4cd9c878efb95b2ca2c130163d5 Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Tue, 24 Nov 2020 00:27:10 +0530 Subject: [PATCH 41/82] More style fixes --- assets/css/twenty-twenty-one.scss | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 6b4f3851c52..b1ffd5b9a7f 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2610,21 +2610,33 @@ a.reset_variations { } .woocommerce { + + & > * { + max-width: var( --responsive--alignwide-width ); + display: block; + margin: var(--global--spacing-vertical) auto; + } + .woocommerce-notices-wrapper { + & > * { - max-width: 47rem; - margin: auto; background: var(--global--color-light-gray); padding: 15px; list-style: none; } } + .return-to-shop,.wc-proceed-to-checkout { + a.button { + margin-top: var(--global--spacing-vertical); + float: left; + display: inline-block; + } + } + .woocommerce-cart-form { + .shop_table_responsive { - max-width: 46rem; - display: block; - margin: auto; margin-top: var(--global--spacing-vertical); margin-bottom: var(--global--spacing-vertical); @@ -2639,10 +2651,6 @@ a.reset_variations { } .cart-collaterals { - margin: auto; - margin-top: var(--global--spacing-vertical); - margin-bottom: var(--global--spacing-vertical); - max-width: 92rem; h2 { margin-bottom: var(--global--spacing-vertical); @@ -2679,14 +2687,6 @@ a.reset_variations { } } - .wc-proceed-to-checkout { - - a.button { - margin-top: var(--global--spacing-vertical); - float: left; - } - } - .cross-sells { li { From 8ffa39b78f38bcc0a8053494f800ad94ec2e86cb Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Mon, 23 Nov 2020 16:09:57 -0500 Subject: [PATCH 42/82] bump wc-blocks package to 3.8.1 --- bin/composer/mozart/composer.lock | 11 ++++--- bin/composer/phpcs/composer.lock | 32 ++++++++++++++++++- bin/composer/phpunit/composer.lock | 50 +++++++++++++++++++++++++++++- bin/composer/wp/composer.lock | 34 +++++++++++++++++++- composer.json | 10 +++--- composer.lock | 16 +++++----- 6 files changed, 132 insertions(+), 21 deletions(-) diff --git a/bin/composer/mozart/composer.lock b/bin/composer/mozart/composer.lock index beb86eb0013..c763f8fbd8b 100644 --- a/bin/composer/mozart/composer.lock +++ b/bin/composer/mozart/composer.lock @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/coenjacobs/mozart.git", - "reference": "b063c0b3c9923fc763e89376e3d671ce450a839a" + "reference": "5d8041fdefc94ff57edcbe83ab468a9988c4fc11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/b063c0b3c9923fc763e89376e3d671ce450a839a", - "reference": "b063c0b3c9923fc763e89376e3d671ce450a839a", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/5d8041fdefc94ff57edcbe83ab468a9988c4fc11", + "reference": "5d8041fdefc94ff57edcbe83ab468a9988c4fc11", "shasum": "" }, "require": { @@ -32,6 +32,7 @@ "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, + "default-branch": true, "bin": [ "bin/mozart" ], @@ -62,7 +63,7 @@ "type": "github" } ], - "time": "2020-11-16T21:14:14+00:00" + "time": "2020-11-23T21:03:43+00:00" }, { "name": "league/flysystem", @@ -695,5 +696,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 9eee228d3be..363928fcb9a 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -71,6 +71,10 @@ "stylecheck", "tests" ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -129,6 +133,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -181,6 +189,10 @@ "polyfill", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, "time": "2019-11-04T15:17:54+00:00" }, { @@ -231,6 +243,10 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, "time": "2019-08-28T14:22:28+00:00" }, { @@ -282,6 +298,11 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2020-10-23T02:01:07+00:00" }, { @@ -322,6 +343,10 @@ "woocommerce", "wordpress" ], + "support": { + "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", + "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master" + }, "time": "2020-08-06T18:23:45+00:00" }, { @@ -368,6 +393,11 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -381,5 +411,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index c39e74f0ed9..3d4ddb93b9f 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -332,6 +332,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -444,6 +448,10 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -604,6 +612,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -908,6 +920,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + }, "time": "2017-03-04T06:30:41+00:00" }, { @@ -1153,6 +1169,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "time": "2019-09-14T09:02:43+00:00" }, { @@ -1204,6 +1224,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1251,6 +1275,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + }, "time": "2017-08-03T12:35:26+00:00" }, { @@ -1296,6 +1324,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + }, "time": "2017-03-29T09:07:27+00:00" }, { @@ -1349,6 +1381,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, "time": "2017-03-03T06:23:57+00:00" }, { @@ -1438,6 +1474,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -1557,6 +1597,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -1606,6 +1650,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1619,5 +1667,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index e081be14315..d1cea76fbfc 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -133,6 +133,10 @@ "translations", "unicode" ], + "support": { + "issues": "https://github.com/php-gettext/Languages/issues", + "source": "https://github.com/php-gettext/Languages/tree/2.6.0" + }, "time": "2019-11-13T10:30:21+00:00" }, { @@ -178,6 +182,10 @@ } ], "description": "Peast is PHP library that generates AST for JavaScript code", + "support": { + "issues": "https://github.com/mck89/peast/issues", + "source": "https://github.com/mck89/peast/tree/v1.11.0" + }, "time": "2020-10-09T15:12:13+00:00" }, { @@ -224,6 +232,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/master" + }, "time": "2019-11-23T21:40:31+00:00" }, { @@ -273,6 +285,10 @@ "iri", "sockets" ], + "support": { + "issues": "https://github.com/rmccue/Requests/issues", + "source": "https://github.com/rmccue/Requests/tree/master" + }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -382,6 +398,10 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", + "support": { + "issues": "https://github.com/wp-cli/i18n-command/issues", + "source": "https://github.com/wp-cli/i18n-command/tree/master" + }, "time": "2020-07-08T15:20:38+00:00" }, { @@ -430,6 +450,9 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -480,6 +503,10 @@ "cli", "console" ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/master" + }, "time": "2018-09-04T13:28:00+00:00" }, { @@ -542,6 +569,11 @@ "cli", "wordpress" ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, "time": "2020-02-18T08:15:37+00:00" } ], @@ -555,5 +587,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/composer.json b/composer.json index d2375ddd79f..636ea2c8856 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", "woocommerce/woocommerce-admin": "1.7.0", - "woocommerce/woocommerce-blocks": "3.8.0" + "woocommerce/woocommerce-blocks": "3.8.1" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4" @@ -99,10 +99,10 @@ }, "extra": { "installer-paths": { - "packages/{$name}": [ - "woocommerce/action-scheduler", - "woocommerce/woocommerce-blocks", - "woocommerce/woocommerce-admin" + "packages/{$name}": [ + "woocommerce/action-scheduler", + "woocommerce/woocommerce-blocks", + "woocommerce/woocommerce-admin" ] }, "scripts-description": { diff --git a/composer.lock b/composer.lock index 2440ade2902..51f750405fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ddeda3843bbb8fd35abf1cea951c47df", + "content-hash": "f522e53a63c340be24470829709cd7ae", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -561,16 +561,16 @@ }, { "name": "woocommerce/woocommerce-blocks", - "version": "v3.8.0", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git", - "reference": "8b7d485ec8d26a6d5c9011dbdb49443cad9beee7" + "reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/8b7d485ec8d26a6d5c9011dbdb49443cad9beee7", - "reference": "8b7d485ec8d26a6d5c9011dbdb49443cad9beee7", + "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/e5aef9eddd13c5511ba673eb70ed8cb3e80d828c", + "reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c", "shasum": "" }, "require": { @@ -606,9 +606,9 @@ ], "support": { "issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues", - "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.0" + "source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.1" }, - "time": "2020-11-10T15:07:11+00:00" + "time": "2020-11-23T20:48:39+00:00" } ], "packages-dev": [ @@ -675,5 +675,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } From 4016b58142eebfbe53be246e96e336942600bae0 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Mon, 23 Nov 2020 16:07:04 -0600 Subject: [PATCH 43/82] Calculate width for product li; improve smaller viewport --- assets/css/twenty-twenty-one.scss | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 96e8c078d9b..b2077c83db9 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2116,28 +2116,36 @@ a.reset_variations { flex-direction: row; flex-wrap: wrap; box-sizing: border-box; + word-break: break-word; + min-width: 12vw; &.columns-2 { li.product { - width: 50% !important; + width: calc( 100% / 2 - 16px ) !important; } } &.columns-3 { li.product { - width: 33.33% !important; + width: calc( 100% / 3 - 16px ) !important; + } + } + + &.columns-4 { + li.product { + width: calc( 100% / 4 - 16px ) !important; } } &.columns-5 { li.product { - width: 20% !important; + width: calc( 100% / 5 - 16px ) !important; } } &.columns-6 { li.product { - width:16.66% !important; + width: calc( 100% / 6 - 16px ) !important; } } @@ -2146,8 +2154,7 @@ a.reset_variations { flex-direction: column; justify-content: space-between; align-items: flex-start; - padding: 0 8px 16px 8px !important; - margin: 0; + margin: 0 8px 16px 8px; box-sizing: border-box; img.attachment-woocommerce_thumbnail { @@ -2195,7 +2202,9 @@ a.reset_variations { ul.products[class*=columns-] { li.product { - width: 100%; + width: auto !important; + margin-left: auto; + margin-right: auto; } } } @@ -2207,18 +2216,12 @@ a.reset_variations { .woocommerce-page { ul.products[class*=columns-] { - + justify-content: center; li.product { width: 50%; - } - - li.product:nth-of-type(2n+1) { padding: 0 2vw 3em 0; } - li.product:nth-of-type(2n) { - padding: 0 0 3em 2vw; - } } .onsale { From e86889b080676824810a5d4fdadffd73845f8c4a Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Mon, 23 Nov 2020 16:17:21 -0600 Subject: [PATCH 44/82] Remove non-WooCommerce specific wp-block-cover styles --- assets/css/twenty-twenty-one.scss | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index b2077c83db9..9428463450f 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2011,7 +2011,7 @@ a.reset_variations { } input[type=checkbox] { - width: 25px !important; + width: 25px !important; } } @@ -2120,32 +2120,37 @@ a.reset_variations { min-width: 12vw; &.columns-2 { + li.product { - width: calc( 100% / 2 - 16px ) !important; + width: calc(100% / 2 - 16px) !important; } } &.columns-3 { + li.product { - width: calc( 100% / 3 - 16px ) !important; + width: calc(100% / 3 - 16px) !important; } } &.columns-4 { + li.product { - width: calc( 100% / 4 - 16px ) !important; + width: calc(100% / 4 - 16px) !important; } } &.columns-5 { + li.product { - width: calc( 100% / 5 - 16px ) !important; + width: calc(100% / 5 - 16px) !important; } } &.columns-6 { + li.product { - width: calc( 100% / 6 - 16px ) !important; + width: calc(100% / 6 - 16px) !important; } } @@ -2217,6 +2222,7 @@ a.reset_variations { ul.products[class*=columns-] { justify-content: center; + li.product { width: 50%; padding: 0 2vw 3em 0; @@ -2477,11 +2483,6 @@ a.reset_variations { * Home page */ .home #main { - - .wp-block-cover { - max-width: none; - } - [class*="woocommerce columns-"] { word-break: break-word; max-width: var(--responsive--aligndefault-width); From 4418e79d0a8ee8a7d263d1107266e339cd9073c6 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 23 Nov 2020 19:29:30 -0300 Subject: [PATCH 45/82] Map all possible taxonomy templates --- includes/class-wc-template-loader.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/class-wc-template-loader.php b/includes/class-wc-template-loader.php index 4ba345a8c90..5a3233756fa 100644 --- a/includes/class-wc-template-loader.php +++ b/includes/class-wc-template-loader.php @@ -155,6 +155,12 @@ class WC_Template_Loader { if ( is_product_taxonomy() ) { $object = get_queried_object(); + + $templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php'; + $templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php'; + $templates[] = 'taxonomy-' . $object->taxonomy . '.php'; + $templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php'; + if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) { $cs_taxonomy = str_replace( '_', '-', $object->taxonomy ); $cs_default = str_replace( '_', '-', $default_file ); @@ -163,11 +169,6 @@ class WC_Template_Loader { $templates[] = 'taxonomy-' . $object->taxonomy . '.php'; $templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '.php'; $templates[] = $cs_default; - } else { - $templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php'; - $templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php'; - $templates[] = 'taxonomy-' . $object->taxonomy . '.php'; - $templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php'; } } From 9d4d419d1c44f47d0a6ac0f35f6e1c2d737feeff Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Mon, 23 Nov 2020 16:50:29 -0600 Subject: [PATCH 46/82] Remove non-WooCommerce specific h2 styles --- assets/css/twenty-twenty-one.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index b12bbb9551f..d3172a3fc99 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -249,11 +249,6 @@ a.button { } #main { - - h2 { - font-weight: 500; - } - .woocommerce-error, .woocommerce-info { font-family: $headings; From e8b2a9adabf8d8f10a424ee7ef5e5b28ad2be4dc Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 23 Nov 2020 20:12:38 -0300 Subject: [PATCH 47/82] Display *-product_ template overrides in Status page --- .../class-wc-rest-system-status-v2-controller.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php b/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php index 2574b19f86a..e2d6569140b 100644 --- a/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php +++ b/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php @@ -1041,6 +1041,12 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { $override_files = array(); $outdated_templates = false; $scan_files = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates/' ); + + // Include *-product_ templates for backwards compatibility. + $scan_files[] = 'content-product_cat.php'; + $scan_files[] = 'taxonomy-product_cat.php'; + $scan_files[] = 'taxonomy-product_tag.php'; + foreach ( $scan_files as $file ) { $located = apply_filters( 'wc_get_template', $file, $file, array(), WC()->template_path(), WC()->plugin_path() . '/templates/' ); @@ -1059,7 +1065,14 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { } if ( ! empty( $theme_file ) ) { - $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file ); + $core_file = $file; + + // Update *-product_ template name before searching in core. + if ( false !== strpos( $core_file, '-product_cat' ) || false !== strpos( $core_file, '-product_tag' ) ) { + $core_file = str_replace( '_', '-', $core_file ); + } + + $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $core_file ); $theme_version = WC_Admin_Status::get_file_version( $theme_file ); if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { if ( ! $outdated_templates ) { From cba0cc47990d7d9e3576301a42720a34f920ad2b Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 23 Nov 2020 20:52:27 -0300 Subject: [PATCH 48/82] Revert "Load product category content with content-product-cat.php" --- includes/class-wc-shortcodes.php | 2 +- includes/wc-template-functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-shortcodes.php b/includes/class-wc-shortcodes.php index b143d2eb224..b8eaa0801a2 100644 --- a/includes/class-wc-shortcodes.php +++ b/includes/class-wc-shortcodes.php @@ -220,7 +220,7 @@ class WC_Shortcodes { foreach ( $product_categories as $category ) { wc_get_template( - 'content-product-cat.php', + 'content-product_cat.php', array( 'category' => $category, ) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index dd97a89858d..cca00d02bd5 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2491,7 +2491,7 @@ if ( ! function_exists( 'woocommerce_output_product_categories' ) ) { foreach ( $product_categories as $category ) { wc_get_template( - 'content-product-cat.php', + 'content-product_cat.php', array( 'category' => $category, ) From a9601fbebf7848f17054ff2236b298734d24f377 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Mon, 23 Nov 2020 21:26:31 -0800 Subject: [PATCH 49/82] Added appropriate styling to checkout page --- assets/css/twenty-twenty-one.scss | 142 +++++++++++++++++------------- 1 file changed, 82 insertions(+), 60 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index f6b2bb67e2d..cfe79ae7e14 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -200,9 +200,9 @@ a.button { .woocommerce-message, .woocommerce-error, .woocommerce-info { - margin-bottom: 5rem; + margin-bottom: 2rem; margin-left: 0; - background: #eee; + background: var(--global--color-background); font-size: 0.88889em; font-family: $headings; list-style: none; @@ -1429,8 +1429,7 @@ a.reset_variations { display: inline-block; width: 14px; height: 14px; - border: 2px solid #fff; - box-shadow: 0 0 0 2px #6d6d6d; + border: var(--form--border-width) solid var(--form--border-color); background: #fff; margin-left: 4px; margin-right: 1.2rem; @@ -1442,7 +1441,7 @@ a.reset_variations { &:checked + label { &::before { - background: #555; + background: var(--global--color-background); } } } @@ -1460,11 +1459,9 @@ a.reset_variations { #shipping_method { list-style: none; margin: 0; - padding: 0 0 1.5rem; font-family: $headings; li { - margin-bottom: 0.5rem; margin-left: 0; input { @@ -1475,6 +1472,7 @@ a.reset_variations { label { line-height: 2.5rem; + margin-bottom: 0; } } } @@ -1520,20 +1518,28 @@ a.reset_variations { height: 48px; } + .select2-container .select2-dropdown { + border: var(--form--border-width) solid var(--form--border-color); + border-radius: var(--form--border-radius); + border-top: none; + } + .select2-container .select2-selection--single .select2-selection__rendered { line-height: 48px; - font-family: $headings; - font-size: 1.6rem; - color: #000; - padding-left: 1.8rem; + } + + .select2-container .select2-selection { + border: var(--form--border-width) solid var(--form--border-color); + border-radius: var(--form--border-radius); } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; } - .select2-container--focus .select2-selection { - border-color: #000; + .select2-container--focus .select2-selection,.select2-container--open .select2-selection { + outline-offset: 2px; + outline: 2px dotted var(--form--border-color); } .select2-results__option { @@ -1543,7 +1549,7 @@ a.reset_variations { .select2-container { .select2-search__field { - height: 4rem; + height: 3rem; background: #eee; } } @@ -1559,6 +1565,39 @@ a.reset_variations { /** * Checkout */ +.woocommerce-form-coupon-toggle .woocommerce-info { + display: block; + margin-bottom: 2rem; + padding: 1rem; +} +.woocommerce-form-coupon { + background: #eee; + padding: 1rem; + font-size: 0.88889em; + color: var(--form--color-text); + + #coupon_code { + border: var(--form--border-width) solid var(--form--border-color); + } + + button[name="apply_coupon"] { + padding: 0.5rem; + border: var(--button--border-width) solid var(--button--color-text); + background: var(--button--color-text); + color: var(--button--color-background); + + &:active { + color: var(--button--color-background-active); + background: transparent; + } + + &:hover { + color: var(--button--color-background-active); + background: transparent; + } + } +} + #ship-to-different-address { font-size: 1em; display: inline-block; @@ -1579,8 +1618,8 @@ a.reset_variations { display: block; height: 16px; width: 30px; - border: 2px solid #bbb; - background: #bbb; + border: 2px solid var(--form--border-color); + background: var(--global--color-primary); border-radius: 13rem; box-sizing: content-box; transition: all ease-in-out 0.3s; @@ -1594,7 +1633,7 @@ a.reset_variations { display: block; width: 14px; height: 14px; - background: #fff; + background: var(--global--color-background); position: absolute; top: 3px; right: 17px; @@ -1609,11 +1648,11 @@ a.reset_variations { input[type="checkbox"]:checked + span::after { right: 3px; + background: var(--global--color-primary); } input[type="checkbox"]:checked + span::before { - border-color: #000; - background: #000; + background: var(--global--color-background); } } } @@ -1681,7 +1720,7 @@ a.reset_variations { .woocommerce-billing-fields { h3 { - margin-top: 4rem; + margin: 2rem 0; } } @@ -1708,10 +1747,6 @@ a.reset_variations { width: 100%; } - input { - border: 1px solid #ddd; - } - label { font-family: $headings; letter-spacing: normal; @@ -1723,7 +1758,7 @@ a.reset_variations { } #order_review_heading { - margin-top: 4rem; + margin-top: 2rem; } #order_review_heading, @@ -1734,7 +1769,7 @@ a.reset_variations { clear: right; .woocommerce-checkout-review-order-table { - margin-top: 2.85rem; + margin-top: 2rem; border: 0; th, @@ -1746,19 +1781,13 @@ a.reset_variations { display: none; } - tbody::after { - content: ""; - display: block; - height: 2rem; - } - .woocommerce-Price-amount { font-weight: bold; } .cart-subtotal, .order-total { - border-top: 1px solid #ddd; + border-top: 2px solid var(--form--border-color); } } } @@ -1815,18 +1844,6 @@ a.reset_variations { } } - input#coupon_code { - padding-top: 1.55rem; - padding-bottom: 1.59rem; - border: 1px solid #ddd; - } - - button[name="apply_coupon"] { - padding-top: 1.55rem; - padding-bottom: 1.8rem; - font-size: 1.6rem; - } - .select2-choice, .select2-choice:hover { box-shadow: none !important; @@ -1842,18 +1859,26 @@ a.reset_variations { .select2-container .select2-selection--single .select2-selection__rendered { line-height: 48px; - font-family: $headings; - font-size: 1.6rem; - color: #000; - padding-left: 1.8rem; + } + + .select2-container .select2-selection { + border: var(--form--border-width) solid var(--form--border-color); + border-radius: var(--form--border-radius); + } + + .select2-container .select2-dropdown { + border: var(--form--border-width) solid var(--form--border-color); + border-radius: var(--form--border-radius); + border-top: none; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; } - .select2-container--focus .select2-selection { - border-color: #000; + .select2-container--focus .select2-selection,.select2-container--open .select2-selection { + outline-offset: 2px; + outline: 2px dotted var(--form--border-color); } .select2-results__option { @@ -1863,7 +1888,7 @@ a.reset_variations { .select2-container { .select2-search__field { - height: 4rem; + height: 3rem; background: #eee; } } @@ -1881,8 +1906,7 @@ a.reset_variations { display: inline-block; width: 14px; height: 14px; - border: 2px solid #fff; - box-shadow: 0 0 0 2px #6d6d6d; + border: var(--form--border-width) solid var(--form--border-color); background: #fff; margin-left: 4px; margin-right: 1.2rem; @@ -1894,7 +1918,7 @@ a.reset_variations { &:checked + label { &::before { - background: #555; + background: var(--global--color-background); } } } @@ -2048,8 +2072,7 @@ a.reset_variations { display: inline-block; width: 14px; height: 14px; - border: 2px solid #fff; - box-shadow: 0 0 0 2px #6d6d6d; + border: var(--form--border-width) solid var(--form--border-color); background: #fff; margin-left: 4px; margin-right: 1.2rem; @@ -2061,7 +2084,7 @@ a.reset_variations { &:checked + label { &::before { - background: #555; + background: var(--global--color-background); } } } @@ -2073,7 +2096,6 @@ a.reset_variations { p { font-family: $headings; - font-size: 1.6rem; } } } @@ -2352,7 +2374,7 @@ a.reset_variations { } #order_review_heading { - margin-top: 4rem; + margin-top: 2rem; } #order_review_heading, From 9d612269875118bd80ff7b0dd14adefb7280835d Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Mon, 23 Nov 2020 21:50:19 -0800 Subject: [PATCH 50/82] Fixed the apply_coupon button --- assets/css/twenty-twenty-one.scss | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index cfe79ae7e14..c49fe3c3ef4 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1582,19 +1582,7 @@ a.reset_variations { button[name="apply_coupon"] { padding: 0.5rem; - border: var(--button--border-width) solid var(--button--color-text); - background: var(--button--color-text); - color: var(--button--color-background); - - &:active { - color: var(--button--color-background-active); - background: transparent; - } - - &:hover { - color: var(--button--color-background-active); - background: transparent; - } + } } From a0b999191e890eb9764406e6b4503f3fc4d5f003 Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Tue, 24 Nov 2020 14:26:23 +0530 Subject: [PATCH 51/82] Merge fixups --- assets/css/twenty-twenty-one.scss | 6 ++++-- includes/class-woocommerce.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index b1ffd5b9a7f..75cef33eb73 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2609,13 +2609,15 @@ a.reset_variations { } } -.woocommerce { - +.alignwide .woocommerce { & > * { max-width: var( --responsive--alignwide-width ); display: block; margin: var(--global--spacing-vertical) auto; } +} + +.woocommerce { .woocommerce-notices-wrapper { diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index a4059876149..c5313fdbd63 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -530,6 +530,9 @@ final class WooCommerce { case 'twentytwenty': include_once WC_ABSPATH . 'includes/theme-support/class-wc-twenty-twenty.php'; break; + case 'twentytwentyone': + include_once WC_ABSPATH . 'includes/theme-support/class-wc-twenty-twenty-one.php'; + break; } } } From 14af0c432b6b2643173ccbd81e701cf06b6d7890 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Tue, 24 Nov 2020 10:58:38 +0100 Subject: [PATCH 52/82] Fixes in the "My Account" page for 2021 theme - Adjust padding under the "My Account" title (was too big) - Adjust color of menu items (was too light) - Adjust thickness of underline on menu items hover (was too thick) - Add some space between the "Hello" line and the next paragraph --- assets/css/twenty-twenty-one.scss | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index f6b2bb67e2d..eaed068acd7 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2616,3 +2616,28 @@ a.reset_variations { } } } + + +.post-9 { + + .entry-header { + + padding-bottom: 20px !important; + } + + .woocommerce-MyAccount-content { + + p:first-of-type { + margin-bottom: 2rem; + } + } + + .woocommerce-MyAccount-navigation-link a { + color: #666 !important; + + &:hover { + color: black !important; + text-decoration: underline solid black 1px !important; + } + } +} From ede094bba87843f71d1ef720e72e48ff1f9caed0 Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Tue, 24 Nov 2020 17:12:17 +0530 Subject: [PATCH 53/82] Removed old styles that conflicts with new. --- assets/css/twenty-twenty-one.scss | 273 +----------------------------- 1 file changed, 6 insertions(+), 267 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 75cef33eb73..f4f60fc17cb 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -186,57 +186,6 @@ a.button { } } -.woocommerce-message, -.woocommerce-error, -.woocommerce-info { - margin-bottom: 5rem; - margin-left: 0; - background: #eee; - font-size: 0.88889em; - font-family: $headings; - list-style: none; - overflow: hidden; -} - -.woocommerce-message, -.woocommerce-error li, -.woocommerce-info { - padding: 1.5rem 3rem; - display: flex; - justify-content: space-between; - align-items: center; - - .button { - order: 2; - } -} - -.woocommerce-message { - background: #eee; - color: $body-color; -} - -.woocommerce-error { - color: #fff; - background: #b22222; - - a { - color: #fff; - - &:hover { - color: #fff; - } - - &.button { - background: #111; - } - } - - > li { - margin: 0; - } -} - #main { .woocommerce-error, @@ -1266,208 +1215,6 @@ a.reset_variations { } } -/** - * Cart - */ -.woocommerce-cart-form { - - img { - max-width: 120px; - height: auto; - display: block; - } - - dl.variation { - margin-top: 1rem; - - dt, - dd, - p { - font-family: $headings; - font-size: 1.4rem; - } - - p, - &:last-child { - margin-bottom: 0; - } - } - - .product-remove { - text-align: center; - } - - .actions { - - .input-text { - width: 280px !important; - float: left; - margin-right: 0.25rem; - border: 1px solid #ddd; - padding-top: 1.7rem; - padding-bottom: 1.9rem; - } - - .button { - background: #f9f9f9; - border: 1px solid #555; - color: #555; - } - - button[name="update_cart"] { - background: #fff; - color: #000; - } - } - - .quantity { - - input { - width: 8rem; - border: 1px solid #eee; - } - } - - table { - border: 0; - - th, - tbody, - td { - border: 0; - } - - td.product-thumbnail { - padding: 1.4rem; - width: 10%; - - img { - height: auto !important; - } - } - - td.product-name { - padding-left: 1.5vw; - } - - tbody { - - tr { - border-top: 1px solid #eee; - } - } - - input.qty { - display: inline-block; - } - } - - .actions { - - button { - padding-top: 1.55rem; - padding-bottom: 1.59rem; - font-size: 1.6rem; - } - } -} - -.cart_totals { - - th, - td { - vertical-align: top; - } - - th { - padding-right: 1rem; - } - - .woocommerce-shipping-destination { - margin-bottom: 1.5rem; - font-family: $headings; - } - - table { - border: 0; - - tbody, - th, - tr, - td { - border: 0; - padding: 1rem; - } - - th { - width: 33%; - } - } - - .checkout-button { - width: 100%; - } - - input[type="radio"].shipping_method { - display: none; - - & + label { - - &::before { - content: ""; - display: inline-block; - width: 14px; - height: 14px; - border: 2px solid #fff; - box-shadow: 0 0 0 2px #6d6d6d; - background: #fff; - margin-left: 4px; - margin-right: 1.2rem; - border-radius: 100%; - transform: translateY(2px); - } - } - - &:checked + label { - - &::before { - background: #555; - } - } - } -} - -.shipping-calculator-button { - margin-top: 0.5rem; - display: inline-block; -} - -.shipping-calculator-form { - margin: 1rem 0 0 0; -} - -#shipping_method { - list-style: none; - margin: 0; - padding: 0 0 1.5rem; - font-family: $headings; - - li { - margin-bottom: 0.5rem; - margin-left: 0; - - input { - float: left; - margin-top: 0.5rem; - margin-right: 0.6rem; - } - - label { - line-height: 2.5rem; - } - } -} - .checkout-button { display: block; padding: 1rem 2rem; @@ -1505,20 +1252,9 @@ a.reset_variations { } } - .select2-container .select2-selection--single { - height: 48px; - } - .select2-container .select2-selection--single .select2-selection__rendered { - line-height: 48px; font-family: $headings; - font-size: 1.6rem; color: #000; - padding-left: 1.8rem; - } - - .select2-container--default .select2-selection--single .select2-selection__arrow { - height: 46px; } .select2-container--focus .select2-selection { @@ -2007,7 +1743,7 @@ a.reset_variations { } input[type=checkbox] { - width: 25px !important; + width: 25px !important; } } @@ -2610,8 +2346,9 @@ a.reset_variations { } .alignwide .woocommerce { + & > * { - max-width: var( --responsive--alignwide-width ); + max-width: var(--responsive--alignwide-width); display: block; margin: var(--global--spacing-vertical) auto; } @@ -2628,7 +2365,9 @@ a.reset_variations { } } - .return-to-shop,.wc-proceed-to-checkout { + .return-to-shop, + .wc-proceed-to-checkout { + a.button { margin-top: var(--global--spacing-vertical); float: left; From 66a830e5e2ddafaa30468b097c93d06fd7de0a5c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Tue, 24 Nov 2020 09:13:37 -0300 Subject: [PATCH 54/82] Bump "Tested up to" tag to WP 5.6 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 31d71a77978..12833f7d8bc 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: automattic, mikejolley, jameskoster, claudiosanches, rodrigosprimo, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, wpmuguru, royho Tags: e-commerce, store, sales, sell, woo, shop, cart, checkout, downloadable, downloads, payments, paypal, storefront, stripe, woo commerce Requires at least: 5.3 -Tested up to: 5.5 +Tested up to: 5.6 Requires PHP: 7.0 Stable tag: 4.6.2 License: GPLv3 From 71d85558ef9ee34a3e85a3bcac276fd93cbb3c90 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Tue, 24 Nov 2020 16:24:36 +0100 Subject: [PATCH 55/82] Changes on "My Account" menu items based on mockup from designer: - Even darker - Smaller font - Reduce space between items - Un-bold --- assets/css/twenty-twenty-one.scss | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index eaed068acd7..2f4dd1f5b58 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2632,12 +2632,19 @@ a.reset_variations { } } - .woocommerce-MyAccount-navigation-link a { - color: #666 !important; + .woocommerce-MyAccount-navigation-link { - &:hover { - color: black !important; - text-decoration: underline solid black 1px !important; + margin-bottom: 20px !important; + + a { + color: #444 !important; + font-weight: normal !important; + font-size: 1.8rem; + + &:hover { + color: black !important; + text-decoration: underline solid black 1px !important; + } } } } From fa47b118168b1f68f6628b6fb705b104eeaff5a2 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 10:19:24 -0800 Subject: [PATCH 56/82] Adjusted the checkbox visibility --- assets/css/twenty-twenty-one.scss | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index c49fe3c3ef4..7b700481d24 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1441,7 +1441,7 @@ a.reset_variations { &:checked + label { &::before { - background: var(--global--color-background); + background: var(--global--color-border); } } } @@ -1582,7 +1582,6 @@ a.reset_variations { button[name="apply_coupon"] { padding: 0.5rem; - } } @@ -1906,7 +1905,7 @@ a.reset_variations { &:checked + label { &::before { - background: var(--global--color-background); + background: var(--global--color-border); } } } @@ -2072,7 +2071,7 @@ a.reset_variations { &:checked + label { &::before { - background: var(--global--color-background); + background: var(--global--color-border); } } } From 4795ee86ddfbe4640a5066b0478fd83dabc5f9f3 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 10:35:10 -0800 Subject: [PATCH 57/82] Adjusted the checkbox --- assets/css/twenty-twenty-one.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 7b700481d24..8487635fbd9 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1326,8 +1326,8 @@ a.reset_variations { } button[name="update_cart"] { - background: #fff; - color: #000; + background: var(--global--color-white); + color: var(--global--color-black); } } @@ -1430,7 +1430,7 @@ a.reset_variations { width: 14px; height: 14px; border: var(--form--border-width) solid var(--form--border-color); - background: #fff; + background: var(--global--color-white); margin-left: 4px; margin-right: 1.2rem; border-radius: 100%; @@ -1894,7 +1894,7 @@ a.reset_variations { width: 14px; height: 14px; border: var(--form--border-width) solid var(--form--border-color); - background: #fff; + background: var(--global--color-white); margin-left: 4px; margin-right: 1.2rem; border-radius: 100%; @@ -2060,7 +2060,7 @@ a.reset_variations { width: 14px; height: 14px; border: var(--form--border-width) solid var(--form--border-color); - background: #fff; + background: var(--global--color-white); margin-left: 4px; margin-right: 1.2rem; border-radius: 100%; From 3921ac3b50f5086394988cda49cfd4de2a44a740 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 11:08:44 -0800 Subject: [PATCH 58/82] Adjusted the dark mode --- assets/css/twenty-twenty-one.scss | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 8487635fbd9..31e853111e3 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1443,6 +1443,10 @@ a.reset_variations { &::before { background: var(--global--color-border); } + + .is-dark-theme &::before { + background: var(--global--color-background); + } } } } @@ -1582,6 +1586,15 @@ a.reset_variations { button[name="apply_coupon"] { padding: 0.5rem; + + .is-dark-theme & { + border-color: var(--global--color-background); + + &:hover, + &:active { + background: var(--global--color-background); + } + } } } @@ -1907,6 +1920,10 @@ a.reset_variations { &::before { background: var(--global--color-border); } + + .is-dark-theme &::before { + background: var(--global--color-background); + } } } @@ -2073,6 +2090,10 @@ a.reset_variations { &::before { background: var(--global--color-border); } + + .is-dark-theme &::before { + background: var(--global--color-background); + } } } } From fb4b9db3f1bf8dbbc04be98331ae75003442480e Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 14:48:17 -0600 Subject: [PATCH 59/82] Remove cart padding; set proceed to checkout button width to 100% --- assets/css/twenty-twenty-one.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index eeba42f1e87..d2be0569a2e 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1308,7 +1308,6 @@ a.reset_variations { .woocommerce { max-width: var(--responsive--alignwide-width); - padding: 0 5vw; margin: 0 auto; } @@ -2458,6 +2457,7 @@ a.reset_variations { margin-top: var(--global--spacing-vertical); float: left; display: inline-block; + width: 100%; } } From 3aeab3571e6cbf8cd129ecbe5c455a7f3b56c30a Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 15:53:58 -0600 Subject: [PATCH 60/82] Fix height of add to cart button --- assets/css/twenty-twenty-one.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 4ba36cbf47d..dd684daa8f6 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -505,8 +505,9 @@ dl.variation, } .single_add_to_cart_button { - padding-top: 1.55rem; - padding-bottom: 1.59rem; + line-height: var(--global--line-height-body) !important; + padding-top: var(--form--spacing-unit) !important; + padding-bottom: var(--form--spacing-unit) !important; font-size: 1.6rem; } From d343527949b907401ef295379119f67078aa2fad Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 14:06:04 -0800 Subject: [PATCH 61/82] Corrected the "on sale" badge display --- assets/css/twenty-twenty-one.scss | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 75f82328c95..e68b4b8fbee 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -173,12 +173,10 @@ a.button { align-items: center; justify-content: center; - &::after { + &::before { content: ''; - display: block; - height: 0; - width: 100%; - padding-bottom: 100%; + float: left; + padding-top: 100%; } } @@ -1311,7 +1309,7 @@ a.reset_variations { } } - + .select2-container .select2-dropdown { border: var(--form--border-width) solid var(--form--border-color); border-radius: var(--form--border-radius); From 0e8e15645d28e63e81713dea436e6d373d433911 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 14:44:42 -0800 Subject: [PATCH 62/82] Corrected cart page according to design --- assets/css/twenty-twenty-one.scss | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index e68b4b8fbee..f650cce6580 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -342,6 +342,8 @@ a.button { td, th { word-break: normal; + border-left: none; + border-right: none; } } } @@ -2527,6 +2529,20 @@ a.reset_variations { min-width: 9rem; } } + + button[name="update_cart"],button[name="apply_coupon"] { + padding: 0.5rem; + color: var(--global--color-primary); + background: var(--global--color-background); + border: var(--form--border-width) solid var(--global--color-primary); + + &:hover, + &:active { + color: var(--global--color-background); + background: var(--global--color-primary); + + } + } } .cart-collaterals { From cbe07cf35efe35783191307ced43b65e82e6d5c1 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 16:49:16 -0600 Subject: [PATCH 63/82] Make tabs look tabby --- assets/css/twenty-twenty-one.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index dd684daa8f6..80baecc4afd 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -765,21 +765,23 @@ a.reset_variations { margin: 0 0 1.5rem; padding: 0; font-family: $headings; + border-bottom: var(--button--border-width) solid var(--button--color-background); li { - margin: 0.5rem 4rem 2rem 0; - + display: inline-flex !important; a { color: $body-color; text-decoration: none; font-weight: 700; + padding: var(--button--padding-vertical) var(--button--padding-horizontal); } &.active { a { - color: $highlights-color; - box-shadow: 0 2px 0 $highlights-color; + color: var(--button--color-text); + background-color: var(--button--color-background); + border: var(--button--border-width) solid var(--button--color-background); } } } From 73a9d865f1a8413f5c33bb19a6688b148ae76bef Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Tue, 24 Nov 2020 14:56:15 -0800 Subject: [PATCH 64/82] Removed bullet points from shipping method selection during checkout --- assets/css/twenty-twenty-one.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index e68b4b8fbee..318ee5e4f0b 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1676,6 +1676,10 @@ a.reset_variations { .woocommerce-checkout-review-order-table { + ul li { + list-style-type: none; + } + input[type="radio"].shipping_method { display: none; From 50690010c63aebfc13a21b0b80808721634dfd4a Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 17:01:20 -0600 Subject: [PATCH 65/82] Adjust the margin around display of variable product price on single product page --- assets/css/twenty-twenty-one.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 80baecc4afd..38ffad8e0c6 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -535,6 +535,10 @@ dl.variation, } } + .woocommerce-variation-price { + margin: 2rem 0; + } + .woocommerce-product-rating { margin: -1rem 0 4rem; line-height: 1; From 6fef73f4696096e51d9e486d5e3b0667e9ff98e6 Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Thu, 19 Nov 2020 16:58:10 +0100 Subject: [PATCH 66/82] Fix overlapping elements in shop items. --- assets/css/twenty-twenty-one.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index ef6d40893e5..32cc5a7dbf4 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -1997,7 +1997,8 @@ a.reset_variations { margin: 0 8px 16px 8px; box-sizing: border-box; - img.attachment-woocommerce_thumbnail { + img.attachment-woocommerce_thumbnail, + img.woocommerce-placeholder { height: auto !important; } } From c29aafd66ddc34d70beb5e7de5a935514341ed53 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 17:52:17 -0600 Subject: [PATCH 67/82] Update targeting for account page styles --- assets/css/twenty-twenty-one.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 1e590d00613..2eb738e621b 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2516,7 +2516,7 @@ a.reset_variations { } } -.post-9 { +.woocommerce-account { .entry-header { From a8c2bac9b2af1d0f37e2d9e332ad444609e77071 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Tue, 24 Nov 2020 18:02:06 -0600 Subject: [PATCH 68/82] Update the my account page colors --- assets/css/twenty-twenty-one.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index 2eb738e621b..851e0423aac 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -2535,13 +2535,13 @@ a.reset_variations { margin-bottom: 20px !important; a { - color: #444 !important; + color: $body-color !important; font-weight: normal !important; font-size: 1.8rem; &:hover { - color: black !important; - text-decoration: underline solid black 1px !important; + color: $body-color !important; + text-decoration: underline solid $body-color 1px !important; } } } From 83c170b88e6db6c2ba50cd75d2ce81a02e92ae1d Mon Sep 17 00:00:00 2001 From: Fernando Marichal Date: Fri, 20 Nov 2020 14:39:51 -0300 Subject: [PATCH 69/82] Version bump wc-admin 1.7.2 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 636ea2c8856..b33f0b6612f 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "pelago/emogrifier": "3.1.0", "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", - "woocommerce/woocommerce-admin": "1.7.0", + "woocommerce/woocommerce-admin": "1.7.2", "woocommerce/woocommerce-blocks": "3.8.1" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 51f750405fd..470fc4a0d3d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f522e53a63c340be24470829709cd7ae", + "content-hash": "3164dbf08d76ea06ac973e836bfe8a9b", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -512,16 +512,16 @@ }, { "name": "woocommerce/woocommerce-admin", - "version": "1.7.0", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-admin.git", - "reference": "14dc0c78ce163ed0d5daf8f83765b65a76f61010" + "reference": "efd94d917504fe71bae650233de47344c8d5c005" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/14dc0c78ce163ed0d5daf8f83765b65a76f61010", - "reference": "14dc0c78ce163ed0d5daf8f83765b65a76f61010", + "url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/efd94d917504fe71bae650233de47344c8d5c005", + "reference": "efd94d917504fe71bae650233de47344c8d5c005", "shasum": "" }, "require": { @@ -555,9 +555,9 @@ "homepage": "https://github.com/woocommerce/woocommerce-admin", "support": { "issues": "https://github.com/woocommerce/woocommerce-admin/issues", - "source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.7.0" + "source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.7.2" }, - "time": "2020-11-11T22:56:39+00:00" + "time": "2020-11-19T17:48:33+00:00" }, { "name": "woocommerce/woocommerce-blocks", From 22352b873d31541237a70080e98599f2dcbe574b Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 24 Nov 2020 22:28:55 -0300 Subject: [PATCH 70/82] 4.7.1 changelog --- changelog.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/changelog.txt b/changelog.txt index 7aae231c2be..4d9eb5dce3c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,14 @@ == Changelog == += 4.7.1 - 2020-11-24 = + +**WooCommerce** + +* Fix - Prevent variable product to be added to cart until a valid variation is selected first. #28103 +* Fix - Restored support for custom `taxonomy-product_cat-.php` and `taxonomy-product_tag-.php` templates. #28377 +* Fix - Display overrides of `taxonomy-product_.php` and `content-product_cat.php` templates in Status page. #28378 +* Dev - Apply `woocommerce_cart_needs_payment` filter in `WC_Checkout::process_checkout()` to make backwards compatible. #28281 + = 4.7.0 - 2020-11-10 = **WooCommerce** From bfbf556c96a8f8aa9da943f0a882fe1d2a8efd20 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 25 Nov 2020 03:08:35 +0000 Subject: [PATCH 71/82] Update dependency automattic/jetpack-autoloader to v2.6.0 --- composer.json | 2 +- composer.lock | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b33f0b6612f..94d6e4e6dbd 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "require": { "php": ">=7.0", - "automattic/jetpack-autoloader": "2.2.0", + "automattic/jetpack-autoloader": "2.6.0", "automattic/jetpack-constants": "1.5.0", "composer/installers": "~1.7", "maxmind-db/reader": "1.6.0", diff --git a/composer.lock b/composer.lock index 470fc4a0d3d..85d1e04d0be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3164dbf08d76ea06ac973e836bfe8a9b", + "content-hash": "61eada68be08c4d163b7aa716837e99e", "packages": [ { "name": "automattic/jetpack-autoloader", - "version": "v2.2.0", + "version": "v2.6.0", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-autoloader.git", - "reference": "66a5d150b3928be718d86696f85631a7f0b98a7b" + "reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/66a5d150b3928be718d86696f85631a7f0b98a7b", - "reference": "66a5d150b3928be718d86696f85631a7f0b98a7b", + "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/47dde8dbca6b1e30f176725f2f748a9abefcaf58", + "reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58", "shasum": "" }, "require": { @@ -31,6 +31,9 @@ "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin" }, "autoload": { + "classmap": [ + "src/AutoloadGenerator.php" + ], "psr-4": { "Automattic\\Jetpack\\Autoloader\\": "src" } @@ -41,9 +44,9 @@ ], "description": "Creates a custom autoloader for a plugin or theme.", "support": { - "source": "https://github.com/Automattic/jetpack-autoloader/tree/master" + "source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.6.0" }, - "time": "2020-08-14T20:34:36+00:00" + "time": "2020-11-19T21:20:12+00:00" }, { "name": "automattic/jetpack-constants", From 2909be0777d97ccdb75d7b825cd1d0df1f79deec Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Wed, 25 Nov 2020 00:10:04 -0500 Subject: [PATCH 72/82] Prevent non-numeric values from throwing a Warning on PHP 7.4+ Resolves #28291 --- includes/admin/reports/class-wc-report-sales-by-date.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/admin/reports/class-wc-report-sales-by-date.php b/includes/admin/reports/class-wc-report-sales-by-date.php index 10938ee633d..899566b1541 100644 --- a/includes/admin/reports/class-wc-report-sales-by-date.php +++ b/includes/admin/reports/class-wc-report-sales-by-date.php @@ -251,7 +251,12 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { ); foreach ( $this->report_data->full_refunds as $key => $order ) { - $this->report_data->full_refunds[ $key ]->net_refund = $order->total_refund - ( $order->total_shipping + $order->total_tax + $order->total_shipping_tax ); + $total_refund = is_numeric( $order->total_refund ) ? $order->total_refund : 0; + $total_shipping = is_numeric( $order->total_shipping ) ? $order->total_shipping : 0; + $total_tax = is_numeric( $order->total_tax ) ? $order->total_tax : 0; + $total_shipping_tax = is_numeric( $order->total_shipping_tax ) ? $order->total_shipping_tax : 0; + + $this->report_data->full_refunds[ $key ]->net_refund = $total_refund - ( $total_shipping + $total_tax + $total_shipping_tax ); } /** From efbd5aa52c1a23a0dc31ea377b106eb157c84774 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 25 Nov 2020 11:10:58 +0000 Subject: [PATCH 73/82] Update dependency automattic/jetpack-constants to v1.5.1 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 94d6e4e6dbd..4ddaf0ce380 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require": { "php": ">=7.0", "automattic/jetpack-autoloader": "2.6.0", - "automattic/jetpack-constants": "1.5.0", + "automattic/jetpack-constants": "1.5.1", "composer/installers": "~1.7", "maxmind-db/reader": "1.6.0", "pelago/emogrifier": "3.1.0", diff --git a/composer.lock b/composer.lock index 85d1e04d0be..91f444cb9fd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "61eada68be08c4d163b7aa716837e99e", + "content-hash": "486f7eb6eda8b5a537d5a6e72c4cbdad", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -50,16 +50,16 @@ }, { "name": "automattic/jetpack-constants", - "version": "v1.5.0", + "version": "v1.5.1", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-constants.git", - "reference": "9827a2f446b8c4faafaf1c740483031c073a381d" + "reference": "18f772daddc8be5df76c9f4a92e017a3c2569a5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/9827a2f446b8c4faafaf1c740483031c073a381d", - "reference": "9827a2f446b8c4faafaf1c740483031c073a381d", + "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/18f772daddc8be5df76c9f4a92e017a3c2569a5b", + "reference": "18f772daddc8be5df76c9f4a92e017a3c2569a5b", "shasum": "" }, "require-dev": { @@ -78,9 +78,9 @@ ], "description": "A wrapper for defining constants in a more testable way.", "support": { - "source": "https://github.com/Automattic/jetpack-constants/tree/master" + "source": "https://github.com/Automattic/jetpack-constants/tree/v1.5.1" }, - "time": "2020-08-13T14:33:09+00:00" + "time": "2020-10-28T19:00:31+00:00" }, { "name": "composer/installers", From beebbb8e255fdd17e9db39e8af99f6d935059f39 Mon Sep 17 00:00:00 2001 From: roykho Date: Wed, 25 Nov 2020 10:12:24 -0800 Subject: [PATCH 74/82] Switch to general panel when virtual is enabled and on shipping tab closes #28267 --- assets/js/admin/meta-boxes-product.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/admin/meta-boxes-product.js b/assets/js/admin/meta-boxes-product.js index d54284dd766..c6edfb3e0b2 100644 --- a/assets/js/admin/meta-boxes-product.js +++ b/assets/js/admin/meta-boxes-product.js @@ -146,6 +146,11 @@ jQuery( function( $ ) { } if ( is_virtual ) { $( '.show_if_virtual' ).show(); + + // If user enables virtual while on shipping tab, switch to general tab. + if ( $( '.shipping_options.shipping_tab' ).hasClass( 'active' ) ) { + $( '.general_options.general_tab > a' ).trigger( 'click' ); + } } $( '.show_if_' + product_type ).show(); From 9f12b34237bcf3a95cf73489b0cf4bdee26cad20 Mon Sep 17 00:00:00 2001 From: roykho Date: Wed, 25 Nov 2020 13:15:56 -0800 Subject: [PATCH 75/82] Fix unwanted html tags showing when searching products in select2 closes #27154 --- includes/class-wc-ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index e0e814c2578..123d5803b74 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -1594,7 +1594,7 @@ class WC_AJAX { $formatted_name .= ' Р' . sprintf( __( 'Stock: %d', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) ); } - $products[ $product_object->get_id() ] = rawurldecode( $formatted_name ); + $products[ $product_object->get_id() ] = rawurldecode( wp_strip_all_tags( $formatted_name ) ); } wp_send_json( apply_filters( 'woocommerce_json_search_found_products', $products ) ); From 3981377809e5e03ccec0365d4f28f564ef9fd04f Mon Sep 17 00:00:00 2001 From: roykho Date: Wed, 25 Nov 2020 13:32:50 -0800 Subject: [PATCH 76/82] Strip the tags from product description on all other select2 fields that performs searches --- includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php | 4 ++-- .../meta-boxes/views/html-product-data-linked-products.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php b/includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php index f6489123a4d..ed3e833c16a 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php @@ -194,7 +194,7 @@ class WC_Meta_Box_Coupon_Data { foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( is_object( $product ) ) { - echo ''; + echo ''; } } ?> @@ -212,7 +212,7 @@ class WC_Meta_Box_Coupon_Data { foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( is_object( $product ) ) { - echo ''; + echo ''; } } ?> diff --git a/includes/admin/meta-boxes/views/html-product-data-linked-products.php b/includes/admin/meta-boxes/views/html-product-data-linked-products.php index 703bce477f4..89f154e490f 100644 --- a/includes/admin/meta-boxes/views/html-product-data-linked-products.php +++ b/includes/admin/meta-boxes/views/html-product-data-linked-products.php @@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit; foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( is_object( $product ) ) { - echo ''; + echo ''; } } ?> @@ -37,7 +37,7 @@ defined( 'ABSPATH' ) || exit; foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( is_object( $product ) ) { - echo ''; + echo ''; } } ?> @@ -53,7 +53,7 @@ defined( 'ABSPATH' ) || exit; foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( is_object( $product ) ) { - echo ''; + echo ''; } } ?> From 26dae12279a0caabcaabbf03ba3ae39aa3eff60b Mon Sep 17 00:00:00 2001 From: OlegApanovich Date: Fri, 20 Nov 2020 15:47:16 +0200 Subject: [PATCH 77/82] Fix toggle chevron issue in admin edit product data attribute section #27923 After chevron clicking on attribute section complete edit product data section toggled insted cliackig area. Key point issue is missing 'postbox' class of wordpress postbox.js library for a attribute block that we try to toggle. --- includes/admin/meta-boxes/views/html-product-attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/meta-boxes/views/html-product-attribute.php b/includes/admin/meta-boxes/views/html-product-attribute.php index 2b987fce19d..fdc9c8aa0a0 100644 --- a/includes/admin/meta-boxes/views/html-product-attribute.php +++ b/includes/admin/meta-boxes/views/html-product-attribute.php @@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } ?> -
+

From b162a1dd8d2a633a7420494963d891a88e7d4418 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Dec 2020 00:59:25 +0000 Subject: [PATCH 78/82] Update babel monorepo --- package-lock.json | 561 +++++++++++++++++++++------------------------- package.json | 6 +- 2 files changed, 259 insertions(+), 308 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a19cee0916..733591474c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "woocommerce", - "version": "4.8.0", + "version": "4.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/cli": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.1.tgz", - "integrity": "sha512-eRJREyrfAJ2r42Iaxe8h3v6yyj1wu9OyosaUHW6UImjGf9ahGL9nsFNh7OCopvtcPL8WnEo7tp78wrZaZ6vG9g==", + "version": "7.12.8", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.8.tgz", + "integrity": "sha512-/6nQj11oaGhLmZiuRUfxsujiPDc9BBReemiXgIbxc+M5W+MIiFKYwvNDJvBfnGKNsJTKbUfEheKc9cwoPHAVQA==", "dev": true, "requires": { - "@nicolo-ribaudo/chokidar-2": "^2.1.8", + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents", "chokidar": "^3.4.0", "commander": "^4.0.1", "convert-source-map": "^1.1.0", @@ -20,117 +20,6 @@ "make-dir": "^2.1.0", "slash": "^2.0.0", "source-map": "^0.5.0" - }, - "dependencies": { - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "optional": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true - }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "@babel/code-frame": { @@ -143,25 +32,25 @@ } }, "@babel/compat-data": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz", - "integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.7.tgz", + "integrity": "sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw==", "dev": true }, "@babel/core": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", - "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz", + "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.1", - "@babel/parser": "^7.12.3", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.7", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.9", + "@babel/types": "^7.12.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -173,43 +62,54 @@ }, "dependencies": { "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", "dev": true }, - "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "@babel/traverse": { + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz", + "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -218,9 +118,9 @@ } }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -292,14 +192,14 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz", - "integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.1", + "@babel/compat-data": "^7.12.5", "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.12.0", + "browserslist": "^4.14.5", "semver": "^5.5.0" }, "dependencies": { @@ -325,13 +225,12 @@ } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.1.tgz", - "integrity": "sha512-rsZ4LGvFTZnzdNZR5HZdmJVuXK8834R5QkF3WvcnBhrlVtF0HSIUC6zbreL9MgjTywhKokn8RIYRiq99+DLAxA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz", + "integrity": "sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-regex": "^7.10.4", "regexpu-core": "^4.7.1" } }, @@ -356,9 +255,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -398,18 +297,18 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", - "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.7" }, "dependencies": { "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -446,52 +345,52 @@ }, "dependencies": { "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", "dev": true }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz", + "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -500,9 +399,9 @@ } }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -517,12 +416,25 @@ } }, "@babel/helper-optimise-call-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", - "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz", + "integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.7" + }, + "dependencies": { + "@babel/types": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-plugin-utils": { @@ -531,15 +443,6 @@ "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, - "@babel/helper-regex": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz", - "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, "@babel/helper-remap-async-to-generator": { "version": "7.11.4", "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.11.4.tgz", @@ -553,55 +456,55 @@ } }, "@babel/helper-replace-supers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz", - "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" }, "dependencies": { "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", "dev": true }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz", + "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -610,9 +513,9 @@ } }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -636,9 +539,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -658,9 +561,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -704,54 +607,54 @@ } }, "@babel/helpers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz", - "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "dev": true, "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" }, "dependencies": { "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz", + "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==", "dev": true }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz", + "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -760,9 +663,9 @@ } }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -865,9 +768,9 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz", - "integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz", + "integrity": "sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -896,9 +799,9 @@ } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.1.tgz", - "integrity": "sha512-c2uRpY6WzaVDzynVY9liyykS+kVU+WRZPMPYpkelXH8KBt1oXoI89kPbZKKG/jDT5UK92FTW2fZkZaJhdiBabw==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz", + "integrity": "sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -1082,12 +985,12 @@ }, "dependencies": { "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/helper-remap-async-to-generator": { @@ -1102,9 +1005,9 @@ } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1395,13 +1298,12 @@ } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.1.tgz", - "integrity": "sha512-CiUgKQ3AGVk7kveIaPEET1jNDhZZEl1RPMWdTBE1799bdz++SwqDHStmxfCtDfBhQgCl38YRiSnrMuUMZIWSUQ==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz", + "integrity": "sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/helper-regex": "^7.10.4" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-template-literals": { @@ -1452,14 +1354,14 @@ } }, "@babel/preset-env": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.1.tgz", - "integrity": "sha512-H8kxXmtPaAGT7TyBvSSkoSTUK6RHh61So05SyEbpmr0MCZrsNYn7mGMzzeYoOUCdHzww61k8XBft2TaES+xPLg==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.7.tgz", + "integrity": "sha512-OnNdfAr1FUQg7ksb7bmbKoby4qFOHw6DKWWUNB9KqnnCldxhxJlP+21dpyaWFmf2h0rTbOkXJtAGevY3XW1eew==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.1", - "@babel/helper-compilation-targets": "^7.12.1", - "@babel/helper-module-imports": "^7.12.1", + "@babel/compat-data": "^7.12.7", + "@babel/helper-compilation-targets": "^7.12.5", + "@babel/helper-module-imports": "^7.12.5", "@babel/helper-plugin-utils": "^7.10.4", "@babel/helper-validator-option": "^7.12.1", "@babel/plugin-proposal-async-generator-functions": "^7.12.1", @@ -1469,10 +1371,10 @@ "@babel/plugin-proposal-json-strings": "^7.12.1", "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1", - "@babel/plugin-proposal-numeric-separator": "^7.12.1", + "@babel/plugin-proposal-numeric-separator": "^7.12.7", "@babel/plugin-proposal-object-rest-spread": "^7.12.1", "@babel/plugin-proposal-optional-catch-binding": "^7.12.1", - "@babel/plugin-proposal-optional-chaining": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.12.7", "@babel/plugin-proposal-private-methods": "^7.12.1", "@babel/plugin-proposal-unicode-property-regex": "^7.12.1", "@babel/plugin-syntax-async-generators": "^7.8.0", @@ -1514,24 +1416,24 @@ "@babel/plugin-transform-reserved-words": "^7.12.1", "@babel/plugin-transform-shorthand-properties": "^7.12.1", "@babel/plugin-transform-spread": "^7.12.1", - "@babel/plugin-transform-sticky-regex": "^7.12.1", + "@babel/plugin-transform-sticky-regex": "^7.12.7", "@babel/plugin-transform-template-literals": "^7.12.1", "@babel/plugin-transform-typeof-symbol": "^7.12.1", "@babel/plugin-transform-unicode-escapes": "^7.12.1", "@babel/plugin-transform-unicode-regex": "^7.12.1", "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.1", - "core-js-compat": "^3.6.2", + "@babel/types": "^7.12.7", + "core-js-compat": "^3.7.0", "semver": "^5.5.0" }, "dependencies": { "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/helper-remap-async-to-generator": { @@ -1586,9 +1488,9 @@ } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz", + "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -3719,13 +3621,23 @@ } }, "@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8.tgz", - "integrity": "sha512-FohwULwAebCUKi/akMFyGi7jfc7JXTeMHzKxuP3umRd9mK/2Y7/SMBSI2jX+YLopPXi+PF9l307NmpfxTdCegA==", + "version": "2.1.8-no-fsevents", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.tgz", + "integrity": "sha512-+nb9vWloHNNMFHjGofEam3wopE3m1yuambrrd/fnPc+lFOMB9ROTqQlche9ByFWNkdNqfSgR/kkQtQ8DzEWt2w==", "dev": true, "optional": true, "requires": { - "chokidar": "2.1.8" + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" } }, "@nodelib/fs.scandir": { @@ -6238,7 +6150,8 @@ "fsevents": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==" + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "optional": true }, "gensync": { "version": "1.0.0-beta.1", @@ -6878,6 +6791,7 @@ "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-serializer": "^25.5.0", "jest-util": "^25.5.0", @@ -23809,15 +23723,52 @@ "dev": true }, "core-js-compat": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.0.tgz", + "integrity": "sha512-o9QKelQSxQMYWHXc/Gc4L8bx/4F7TTraE5rhuN8I7mKBt5dBIUpXpIR3omv70ebr8ST5R3PqbDQr+ZI3+Tt1FQ==", "dev": true, "requires": { - "browserslist": "^4.8.5", + "browserslist": "^4.14.7", "semver": "7.0.0" }, "dependencies": { + "browserslist": { + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" + } + }, + "caniuse-lite": { + "version": "1.0.30001163", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001163.tgz", + "integrity": "sha512-QQbOGkHWnvhn3Dlf4scPlXTZVhGOK+2qCOP5gPxqzXHhtn3tZHwNdH9qNcQRWN0f3tDYrsyXFJCFiP/GLzI5Vg==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.611", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.611.tgz", + "integrity": "sha512-YhqTzCXtEO2h0foGLGS60ortd6yY/yUQhqDEp1VWG3DIyHvckFFyaRwR41M0/M3m7Yb8Exqh+nzyb2TuxaoMTw==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "node-releases": { + "version": "1.1.67", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz", + "integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==", + "dev": true + }, "semver": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", @@ -34613,9 +34564,9 @@ "dev": true }, "regenerate": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", - "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, "regenerate-unicode-properties": { diff --git a/package.json b/package.json index 513ddc6a1d5..a4f13005780 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ "git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install" }, "devDependencies": { - "@babel/cli": "7.12.1", - "@babel/core": "7.12.3", + "@babel/cli": "7.12.8", + "@babel/core": "7.12.9", "@babel/polyfill": "7.12.1", - "@babel/preset-env": "7.12.1", + "@babel/preset-env": "7.12.7", "@babel/register": "7.12.1", "@typescript-eslint/eslint-plugin": "3.10.1", "@typescript-eslint/experimental-utils": "3.10.1", From 7ffa622b30acf623129c01d693bbc4ccea68f59d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Dec 2020 14:17:11 +0000 Subject: [PATCH 79/82] Update dependency config to v3.3.3 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 733591474c6..5d35bc9430f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23184,9 +23184,9 @@ } }, "config": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/config/-/config-3.3.2.tgz", - "integrity": "sha512-NlGfBn2565YA44Irn7GV5KHlIGC3KJbf0062/zW5ddP9VXIuRj0m7HVyFAWvMZvaHPEglyGfwmevGz3KosIpCg==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.3.tgz", + "integrity": "sha512-T3RmZQEAji5KYqUQpziWtyGJFli6Khz7h0rpxDwYNjSkr5ynyTWwO7WpfjHzTXclNCDfSWQRcwMb+NwxJesCKw==", "dev": true, "requires": { "json5": "^2.1.1" diff --git a/package.json b/package.json index a4f13005780..873cc145bc0 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "chai": "4.2.0", "chai-as-promised": "7.1.1", "commander": "4.1.1", - "config": "3.3.2", + "config": "3.3.3", "cross-env": "6.0.3", "deasync": "0.1.20", "eslint": "6.8.0", From b95e88fd364a8bbfd0115c00ad9ac716727c3d04 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Dec 2020 14:21:43 +0000 Subject: [PATCH 80/82] Update dependency deasync to v0.1.21 --- package-lock.json | 10 ++++------ package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 733591474c6..14930d39d5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6150,8 +6150,7 @@ "fsevents": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "optional": true + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==" }, "gensync": { "version": "1.0.0-beta.1", @@ -6791,7 +6790,6 @@ "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-serializer": "^25.5.0", "jest-util": "^25.5.0", @@ -24010,9 +24008,9 @@ "dev": true }, "deasync": { - "version": "0.1.20", - "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.20.tgz", - "integrity": "sha512-E1GI7jMI57hL30OX6Ht/hfQU8DO4AuB9m72WFm4c38GNbUD4Q03//XZaOIHZiY+H1xUaomcot5yk2q/qIZQkGQ==", + "version": "0.1.21", + "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.21.tgz", + "integrity": "sha512-kUmM8Y+PZpMpQ+B4AuOW9k2Pfx/mSupJtxOsLzmnHY2WqZUYRFccFn2RhzPAqt3Xb+sorK/badW2D4zNzqZz5w==", "dev": true, "requires": { "bindings": "^1.5.0", diff --git a/package.json b/package.json index a4f13005780..95525adee61 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "commander": "4.1.1", "config": "3.3.2", "cross-env": "6.0.3", - "deasync": "0.1.20", + "deasync": "0.1.21", "eslint": "6.8.0", "eslint-config-wpcalypso": "5.0.0", "eslint-plugin-jest": "23.20.0", From 5eaafaeea7588f1acb1048718e49253c01e006b2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Dec 2020 14:26:13 +0000 Subject: [PATCH 81/82] Update dependency grunt-stylelint to v0.16.0 --- package-lock.json | 18 ++++++++---------- package.json | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 733591474c6..3ff6d7c85aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6150,8 +6150,7 @@ "fsevents": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "optional": true + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==" }, "gensync": { "version": "1.0.0-beta.1", @@ -6791,7 +6790,6 @@ "@types/graceful-fs": "^4.1.2", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-serializer": "^25.5.0", "jest-util": "^25.5.0", @@ -27451,12 +27449,12 @@ "dev": true }, "grunt-stylelint": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.15.0.tgz", - "integrity": "sha512-1G5kbT3Y6OtAqgIv/XErtI6ai1t1UdtQWXxUV5Gd900PQoEzu/WrBYhGNAXdb/9nAsNWNjFHQjtdXQtZcDmobA==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.16.0.tgz", + "integrity": "sha512-ullm0h9iCdgPEDq1TNwKL5HteXA4zke6wbYoRtsO32ATCU3zfUXmDN9unhu+joEcdgJKOPcd2+7UhRNXO1rr+w==", "dev": true, "requires": { - "chalk": "^3.0.0" + "chalk": "^4.1.0" }, "dependencies": { "ansi-styles": { @@ -27469,9 +27467,9 @@ } }, "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", diff --git a/package.json b/package.json index a4f13005780..5e4b2c4a411 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "grunt-postcss": "0.9.0", "grunt-rtlcss": "2.0.2", "grunt-sass": "3.1.0", - "grunt-stylelint": "0.15.0", + "grunt-stylelint": "0.16.0", "gruntify-eslint": "5.0.0", "husky": "4.3.0", "istanbul": "1.0.0-alpha.2", From d6d68ed9cd3a97e9b72b4d5867bb038321729541 Mon Sep 17 00:00:00 2001 From: Gustavo Bordoni Date: Tue, 1 Dec 2020 13:16:53 -0500 Subject: [PATCH 82/82] Remove white space. --- includes/admin/reports/class-wc-report-sales-by-date.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/reports/class-wc-report-sales-by-date.php b/includes/admin/reports/class-wc-report-sales-by-date.php index 899566b1541..705917bef77 100644 --- a/includes/admin/reports/class-wc-report-sales-by-date.php +++ b/includes/admin/reports/class-wc-report-sales-by-date.php @@ -255,7 +255,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { $total_shipping = is_numeric( $order->total_shipping ) ? $order->total_shipping : 0; $total_tax = is_numeric( $order->total_tax ) ? $order->total_tax : 0; $total_shipping_tax = is_numeric( $order->total_shipping_tax ) ? $order->total_shipping_tax : 0; - + $this->report_data->full_refunds[ $key ]->net_refund = $total_refund - ( $total_shipping + $total_tax + $total_shipping_tax ); }