This also updates the woocommerce/woocommerce-admin and woocommerce/woocommerce-blocks packages as their dependence on `composer/installers` precludes update otherwise
This commit fixes a minor error in the sed commands used to prefix
namespaces in the vendor folder. Due to an extra space sed was
considering `.bak` an extra parameter. If we use `-i.bak` instead (without the
space), sed creates a backup file which is the desired behavior.
With this change we won't be getting the errors below when running
`composer install` or `composer update`:
```
Generating autoload files
> sh ./bin/prefix-vendor-namespaces.sh
Prefixing the appropriate vendor namespaces with Automattic\WooCommerce\Vendor
sed: can't read .bak: No such file or directory
sed: can't read .bak: No such file or directory
sed: can't read .bak: No such file or directory
(...)
```
Since sed was working without creating a backup file, I wonder if we
really need to create one. I tested and `sed -i -E -e
"s/\"(League\\\\\\\Container)/\"Automattic\\\\\\\WooCommerce\\\\\\\Vendor\\\\\\\\\1/g"
vendor/league/container/composer.json` works well in Linux. If it also
works on Mac, maybe we can use it and remove the code that deletes the
.bak files?
This commit simply adds github-actions[bot] (a bot used in the
woocommerce-blocks repository) to the list of users ignored
by the bin/contributors.sh script.
Now that woocommerce-rest-api was merged back into the WC core
repository, we don't need to check contributions in the depreacted
woocommerce-rest-api repository.
All the classes in the package are re-namespaced from
"Leage\Container" to "Automattic\WooCommerce\Vendor\League\Container"
to prevent conflicts with extensions using the same plugin.
The re-namespacing is done by using a simple text substitution
on all the code files (see prefix-vendor-namespaces.sh), for this
particular case this approach is enough.
The pre-push hook uses sh but contained syntax that is only supported by
bash. `=` in sh should be used instead of `==` to check for string
equality. Before this change, we were getting the following error when
pushing to any branch:
```
git push
husky > pre-push (node v10.22.1)
./bin/pre-push.sh: 7: [: refs/heads/master: unexpected operator
```
This error didn't block the push, but meant that the message asking
developers to confirm if they wanted to push to master was never
displayed. This problem was introduced in commit
8c25557bf5 added in PR #27028.
This commit tweaks the function runOnChange() to make sure it always
returns the correct exit status. Before this change, this function would
return 1 instead of 0 when there was no change to composer.lock and
package-lock.json in the commits that were merged. This resulted in
husky mistakenly reporting a failure when actually the post-merge script
succeeded.