Make WordPress Core

Ticket #47767: 47767.8.diff

File 47767.8.diff, 65.4 KB (added by pento, 6 years ago)
  • new file .env

    diff --git a/.env b/.env
    new file mode 100644
    index 0000000000..2d37da3861
    - +  
     1##
     2# Default configuration options for the local dev environment.
     3#
     4# All of these options can be overriden by setting them as environment variables before starting
     5# the environment. You will need to restart your environment when changing any of these.
     6##
     7
     8# The site will be available at http://localhost:LOCAL_PORT
     9LOCAL_PORT=8889
     10
     11# Where to run WordPress from. Valid options are 'src' and 'build'.
     12LOCAL_DIR=src
     13
     14# The PHP version to use. Valid options are 'latest', and '{version}-fpm', where '{version}' is any
     15# x.y PHP version from 5.2 onwards.
     16LOCAL_PHP=latest
     17
     18# Whether or not to enable XDebug.
     19LOCAL_PHP_XDEBUG=false
     20
     21# The MySQL version to use. See https://hub.docker.com/_/mysql/ for valid versions.
     22LOCAL_MYSQL=5.7
     23
     24# The debug settings to add to `wp-config.php`.
     25LOCAL_WP_DEBUG=true
     26LOCAL_WP_DEBUG_LOG=true
     27LOCAL_WP_DEBUG_DISPLAY=true
     28LOCAL_SCRIPT_DEBUG=true
     29
     30# Merge the debug settings for passing to `wp config create`.
     31LOCAL_WP_CONFIG="define( 'WP_DEBUG', ${LOCAL_WP_DEBUG} );\ndefine( 'WP_DEBUG_LOG', ${LOCAL_WP_DEBUG_LOG} );\ndefine( 'LOCAL_WP_DEBUG_DISPLAY', ${LOCAL_WP_DEBUG_DISPLAY} );\ndefine( 'LOCAL_SCRIPT_DEBUG', ${LOCAL_SCRIPT_DEBUG} );\n"
  • .travis.yml

    diff --git a/.travis.yml b/.travis.yml
    index 7725c722d5..15ed25bd35 100644
    a b  
    1 sudo: false
    2 dist: trusty
    31language: php
     2services:
     3  - docker
     4  - mysql
     5
     6addons:
     7  apt:
     8    packages:
     9      - docker-ce
     10
    411cache:
    512  apt: true
    613  directories:
    714    - $HOME/.npm
    815    - vendor
    916    - $HOME/.composer/cache
     17
    1018env:
    1119  global:
    12     - WP_TRAVISCI=travis:phpunit
     20    - LOCAL_DIR=build
     21
    1322matrix:
    1423  include:
    15   - php: 7.2
    16     env: WP_TRAVISCI=e2e
    17   - php: 7.2
    18     env: WP_TRAVISCI=travis:phpcs
    19   - php: 7.1
    20     env: WP_TRAVISCI=travis:js
    21   - php: 7.4snapshot
    22   - php: 7.3
     24  - env: WP_TRAVISCI=test:e2e
     25  - env: WP_TRAVISCI=travis:phpcs
     26  - env: WP_TRAVISCI=travis:js
     27  - env: LOCAL_PHP=7.3-fpm WP_TRAVISCI=test:php
    2328  - php: 7.3
    24     env: WP_TRAVIS_OBJECT_CACHE=true
     29    dist: trusty
     30    env: WP_TRAVIS_OBJECT_CACHE=true WP_TRAVISCI=travis:phpunit
    2531    services: memcached
    26   - php: 7.2
    27   - php: 7.1
    28   - php: 7.0
    29     env: WP_TEST_REPORTER=true
    30   - php: 5.6
     32  - env: LOCAL_PHP=7.2-fpm WP_TRAVISCI=test:php
     33  - env: LOCAL_PHP=7.1-fpm WP_TRAVISCI=test:php
     34  - env: LOCAL_PHP=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php
     35  - env: LOCAL_PHP=5.6-fpm WP_TRAVISCI=test:php
     36  - php: 7.4snapshot
     37    dist: trusty
     38    env: WP_TRAVISCI=travis:phpunit
    3139  - php: nightly
     40    dist: trusty
     41    env: WP_TRAVISCI=travis:phpunit
    3242  allow_failures:
    3343  - php: 7.4snapshot
    3444  - php: nightly
    3545  fast_finish: true
     46
    3647before_install:
    3748- |
    3849  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
    before_install: 
    4354      sed -i "s/yourpasswordhere//" wp-tests-config.php
    4455      travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
    4556  fi
     57- |
     58  if [[ "$WP_TRAVISCI" == "test:php" ]]; then
     59      cp wp-tests-config-sample.php wp-tests-config.php
     60      sed -i "s/youremptytestdbnamehere/wordpress_develop_tests/" wp-tests-config.php
     61      sed -i "s/yourusernamehere/root/" wp-tests-config.php
     62      sed -i "s/yourpasswordhere/password/" wp-tests-config.php
     63      sed -i "s/localhost/mysql/" wp-tests-config.php
     64      travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
     65  fi
     66- |
     67  sudo rm /usr/local/bin/docker-compose
     68  curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > docker-compose
     69  chmod +x docker-compose
     70  sudo mv docker-compose /usr/local/bin
    4671- |
    4772  if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
    4873    cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php
    4974    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    5075  fi
     76
    5177before_script:
    5278- |
    5379  # Remove Xdebug for a huge performance increase:
    before_script: 
    5783    echo "xdebug.ini does not exist"
    5884  fi
    5985- |
    60   # Export Composer's global bin dir to PATH, but not on PHP 5.2:
     86  # Export Composer's global bin dir to PATH:
    6187  composer config --list --global
    6288  export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
    6389- |
    64   # Install the specified version of PHPUnit depending on the PHP version:
     90  # Install PHPUnit for the tests that don't run in Docker.
    6591  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
    66     case "$TRAVIS_PHP_VERSION" in
    67       7.4snapshot|7.3|7.2|7.1|nightly)
    68         echo "Using PHPUnit 7.x"
    69         travis_retry composer global require "phpunit/phpunit:^7"
    70         ;;
    71       7.0)
    72         echo "Using PHPUnit 6.x"
    73         travis_retry composer global require "phpunit/phpunit:^6"
    74         ;;
    75       5.6)
    76         echo "Using PHPUnit 4.x"
    77         travis_retry composer global require "phpunit/phpunit:^4"
    78         ;;
    79       *)
    80         echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
    81         exit 1
    82         ;;
    83     esac
     92    echo "Using PHPUnit 7.x"
     93    travis_retry composer global require "phpunit/phpunit:^7"
    8494  fi
    8595- |
    8696  # We only need to run composer install on the PHP coding standards job.
    before_script: 
    93103- nvm install 10.13.0
    94104- npm install
    95105- npm prune
     106- |
     107  if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
     108    npm run env:start
     109    npm run build
     110  fi
     111- |
     112  if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
     113    npm run env:install
     114  fi
    96115- mysql --version
    97116- phpenv versions
    98117- php --version
    before_script: 
    105124- git --version
    106125- svn --version
    107126- locale -a
     127
    108128script:
    109 - |
    110   if [[ "$WP_TRAVISCI" == "e2e" ]]; then
    111     npm run env:start
    112     npm run env:reset-site
    113     npm run test:e2e
    114   else
    115     npm run grunt $WP_TRAVISCI
    116   fi
     129  - |
     130    if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
     131      npm run test:e2e
     132    elif [[ "$WP_TRAVISCI" == "test:php" ]]; then
     133      npm run test:php -- -- -- --verbose -c phpunit.xml.dist
     134      npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group ajax
     135      npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml
     136      npm run test:php -- -- -- --verbose -c tests/phpunit/multisite.xml --group ms-files
     137      npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group external-http
     138      npm run test:php -- -- -- --verbose -c phpunit.xml.dist --group restapi-jsclient
     139    else
     140      npm run grunt $WP_TRAVISCI
     141    fi
     142
    117143after_script:
    118144- |
    119145  if [[ "$WP_TEST_REPORTER" == "true" ]]; then
    after_script: 
    122148    export WPT_TEST_DIR=$(pwd)
    123149    php test-runner/report.php
    124150  fi
     151
    125152notifications:
    126153  slack:
    127154    rooms:
  • new file README.md

    diff --git a/README.md b/README.md
    new file mode 100644
    index 0000000000..94d14ee6e6
    - +  
     1# WordPress
     2
     3[![Build Status](https://img.shields.io/travis/com/WordPress/wordpress-develop/master.svg)](https://travis-ci.com/WordPress/wordpress-develop)
     4
     5Welcome to the WordPress development repository! Please check out our [contributor handbook](https://make.wordpress.org/core/handbook/) for information about how to open bug reports, contribute patches, test, documention, or get involved in any way you can.
     6
     7## Getting Started
     8
     9WordPress is a PHP/MySQL-based project, we have a basic development environment that you can quickly get up and running with a few commands. First off, you will need to download and install [Docker](https://www.docker.com/products/docker-desktop), if you don't have it already. After that, there are a few commands to run:
     10
     11### Development Environment Commands
     12
     13`npm install`
     14
     15This will download some dependencies that WordPress needs to get itself up and running.
     16
     17`npm run dev`
     18
     19This will do some build work, and copy the built files into the correct location.
     20
     21`npm run env:start`
     22
     23This will download the Docker images needed, and start them up.
     24
     25`npm run env:install`
     26
     27This will set up WordPress with all of the standard settings. You can now access WordPress at http://localhost:8889, with the default username _admin_, and the default password _password_.
     28
     29Congratulations! You can now work on WordPress! Here are some extra commands that will help you along the way:
     30
     31`npm run env:stop`
     32
     33If you prefer to stop your Docker containers when you're not using them, this command will stop them. You can always restart them by running `npm run env:start` again.
     34
     35`npm run env:clean` / `npm run env:reset`
     36
     37These can be used to clean up your development environment if things aren't working correctly. The former will delete the database and some temporary files, while the latter will remove all images, so the next time you run `npm run env:start`, they'll be downloaded fresh.
     38
     39`npm run env:cli`
     40
     41This will run the [WP-CLI tool](https://make.wordpress.org/cli/handbook/). WP-CLI has a lot of [useful commands](https://developer.wordpress.org/cli/commands/) you can use to work on your WordPress site. Where the documentation mentions running `wp`, run `npm run env-cli` instead. For example, `npm run env:cli help`.
     42
     43`npm run test:php` / `npm run test:e2e`
     44
     45These commands will run the PHP and E2E test suites, respectively.
     46
     47### Development Environment Settings
     48
     49You can also customise the development environment by setting particular environment variables before starting it. After changing any of these settings, you'll need to run `npm run env:stop` then `npm run env:start` before they take effect.
     50
     51Each OS has a slightly different way of setting environment variables. In these examples, substitute `VARIABLE_NAME` for the name of the setting you want to change, and `value` for the value you want to set it to.
     52
     53Linux, MacOS, and WSL: `export VARIABLE_NAME=value`
     54Windows (DOS/CMD.exe): `SET VARIABLE_NAME=value`
     55Windows (PowerShell): `Set-Item Env:VARIABLE_NAME=value`
     56
     57`LOCAL_PORT`
     58
     59Change the port number that the site will be available on. You'll need to run `npm run env:install` after changing this.
     60
     61`LOCAL_DIR`
     62
     63Change whether the site runs from the `src` or `build` directory.
     64
     65`LOCAL_PHP`
     66
     67The PHP version to use when running the site. Valid options are 'latest', and '{version}-fpm', where '{version}' is any x.y PHP version from 5.2 onwards.
     68
     69`LOCAL_PHP_XDEBUG`
     70
     71Set to `true` or `false` to enable or disable the XDebug module in PHP.
     72
     73`LOCAL_MYSQL`
     74
     75The MySQL version to use. See https://hub.docker.com/_/mysql/ for valid versions. If you downgrade the MySQL version, you may need to run `npm run env:clean` to reset the MySQL data files.
     76
     77`LOCAL_WP_DEBUG` / `LOCAL_WP_DEBUG_LOG` / `LOCAL_WP_DEBUG_DISPLAY` / `LOCAL_SCRIPT_DEBUG`
     78
     79The debug settings to add to `wp-config.php`. Set to `true` or `false` to change their corresponding debug setting. If you already have a site up and running, it may be easier to just edit these in the `wp-config.php` file.
  • package-lock.json

    diff --git a/package-lock.json b/package-lock.json
    index 8876f74f06..39a9efb410 100644
    a b  
    10841084                        "resolved": "https://registry.npmjs.org/@financial-times/useragent_parser/-/useragent_parser-1.0.2.tgz",
    10851085                        "integrity": "sha512-zuJMxn5Qnk7CKl+zrVXDqXs0F+p4tshO6B4s8VenJj34EEVuV4iZIbkGiEFJUbn29z9Mcn6k8yfj9qSCNDcPPQ=="
    10861086                },
     1087                "@hapi/address": {
     1088                        "version": "2.0.0",
     1089                        "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.0.0.tgz",
     1090                        "integrity": "sha512-mV6T0IYqb0xL1UALPFplXYQmR0twnXG0M6jUswpquqT2sD12BOiCiLy3EvMp/Fy7s3DZElC4/aPjEjo2jeZpvw==",
     1091                        "dev": true
     1092                },
     1093                "@hapi/hoek": {
     1094                        "version": "6.2.4",
     1095                        "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-6.2.4.tgz",
     1096                        "integrity": "sha512-HOJ20Kc93DkDVvjwHyHawPwPkX44sIrbXazAUDiUXaY2R9JwQGo2PhFfnQtdrsIe4igjG2fPgMra7NYw7qhy0A==",
     1097                        "dev": true
     1098                },
     1099                "@hapi/joi": {
     1100                        "version": "15.1.0",
     1101                        "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-15.1.0.tgz",
     1102                        "integrity": "sha512-n6kaRQO8S+kepUTbXL9O/UOL788Odqs38/VOfoCrATDtTvyfiO3fgjlSRaNkHabpTLgM7qru9ifqXlXbXk8SeQ==",
     1103                        "dev": true,
     1104                        "requires": {
     1105                                "@hapi/address": "2.x.x",
     1106                                "@hapi/hoek": "6.x.x",
     1107                                "@hapi/marker": "1.x.x",
     1108                                "@hapi/topo": "3.x.x"
     1109                        }
     1110                },
     1111                "@hapi/marker": {
     1112                        "version": "1.0.0",
     1113                        "resolved": "https://registry.npmjs.org/@hapi/marker/-/marker-1.0.0.tgz",
     1114                        "integrity": "sha512-JOfdekTXnJexfE8PyhZFyHvHjt81rBFSAbTIRAhF2vv/2Y1JzoKsGqxH/GpZJoF7aEfYok8JVcAHmSz1gkBieA==",
     1115                        "dev": true
     1116                },
     1117                "@hapi/topo": {
     1118                        "version": "3.1.2",
     1119                        "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-3.1.2.tgz",
     1120                        "integrity": "sha512-r+aumOqJ5QbD6aLPJWqVjMAPsx5pZKz+F5yPqXZ/WWG9JTtHbQqlzrJoknJ0iJxLj9vlXtmpSdjlkszseeG8OA==",
     1121                        "dev": true,
     1122                        "requires": {
     1123                                "@hapi/hoek": "8.x.x"
     1124                        },
     1125                        "dependencies": {
     1126                                "@hapi/hoek": {
     1127                                        "version": "8.0.2",
     1128                                        "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.0.2.tgz",
     1129                                        "integrity": "sha512-O6o6mrV4P65vVccxymuruucb+GhP2zl9NLCG8OdoFRS8BEGw3vwpPp20wpAtpbQQxz1CEUtmxJGgWhjq1XA3qw==",
     1130                                        "dev": true
     1131                                }
     1132                        }
     1133                },
    10871134                "@jest/console": {
    10881135                        "version": "24.7.1",
    10891136                        "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz",
     
    36723719                                "trim-right": "^1.0.1"
    36733720                        }
    36743721                },
     3722                "babel-helper-bindify-decorators": {
     3723                        "version": "6.24.1",
     3724                        "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz",
     3725                        "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=",
     3726                        "dev": true,
     3727                        "requires": {
     3728                                "babel-runtime": "^6.22.0",
     3729                                "babel-traverse": "^6.24.1",
     3730                                "babel-types": "^6.24.1"
     3731                        }
     3732                },
     3733                "babel-helper-builder-binary-assignment-operator-visitor": {
     3734                        "version": "6.24.1",
     3735                        "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
     3736                        "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
     3737                        "dev": true,
     3738                        "requires": {
     3739                                "babel-helper-explode-assignable-expression": "^6.24.1",
     3740                                "babel-runtime": "^6.22.0",
     3741                                "babel-types": "^6.24.1"
     3742                        }
     3743                },
    36753744                "babel-helper-call-delegate": {
    36763745                        "version": "6.24.1",
    36773746                        "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
     
    36943763                                "lodash": "^4.17.4"
    36953764                        }
    36963765                },
     3766                "babel-helper-explode-assignable-expression": {
     3767                        "version": "6.24.1",
     3768                        "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
     3769                        "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
     3770                        "dev": true,
     3771                        "requires": {
     3772                                "babel-runtime": "^6.22.0",
     3773                                "babel-traverse": "^6.24.1",
     3774                                "babel-types": "^6.24.1"
     3775                        }
     3776                },
     3777                "babel-helper-explode-class": {
     3778                        "version": "6.24.1",
     3779                        "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz",
     3780                        "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=",
     3781                        "dev": true,
     3782                        "requires": {
     3783                                "babel-helper-bindify-decorators": "^6.24.1",
     3784                                "babel-runtime": "^6.22.0",
     3785                                "babel-traverse": "^6.24.1",
     3786                                "babel-types": "^6.24.1"
     3787                        }
     3788                },
    36973789                "babel-helper-function-name": {
    36983790                        "version": "6.24.1",
    36993791                        "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
     
    37433835                                "lodash": "^4.17.4"
    37443836                        }
    37453837                },
     3838                "babel-helper-remap-async-to-generator": {
     3839                        "version": "6.24.1",
     3840                        "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
     3841                        "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
     3842                        "dev": true,
     3843                        "requires": {
     3844                                "babel-helper-function-name": "^6.24.1",
     3845                                "babel-runtime": "^6.22.0",
     3846                                "babel-template": "^6.24.1",
     3847                                "babel-traverse": "^6.24.1",
     3848                                "babel-types": "^6.24.1"
     3849                        }
     3850                },
    37463851                "babel-helper-replace-supers": {
    37473852                        "version": "6.24.1",
    37483853                        "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
     
    39104015                                "@types/babel__traverse": "^7.0.6"
    39114016                        }
    39124017                },
     4018                "babel-plugin-syntax-async-functions": {
     4019                        "version": "6.13.0",
     4020                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
     4021                        "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
     4022                        "dev": true
     4023                },
     4024                "babel-plugin-syntax-async-generators": {
     4025                        "version": "6.13.0",
     4026                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz",
     4027                        "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
     4028                        "dev": true
     4029                },
     4030                "babel-plugin-syntax-class-constructor-call": {
     4031                        "version": "6.18.0",
     4032                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz",
     4033                        "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=",
     4034                        "dev": true
     4035                },
     4036                "babel-plugin-syntax-class-properties": {
     4037                        "version": "6.13.0",
     4038                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz",
     4039                        "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=",
     4040                        "dev": true
     4041                },
     4042                "babel-plugin-syntax-decorators": {
     4043                        "version": "6.13.0",
     4044                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz",
     4045                        "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
     4046                        "dev": true
     4047                },
     4048                "babel-plugin-syntax-do-expressions": {
     4049                        "version": "6.13.0",
     4050                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz",
     4051                        "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=",
     4052                        "dev": true
     4053                },
     4054                "babel-plugin-syntax-dynamic-import": {
     4055                        "version": "6.18.0",
     4056                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
     4057                        "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
     4058                        "dev": true
     4059                },
     4060                "babel-plugin-syntax-exponentiation-operator": {
     4061                        "version": "6.13.0",
     4062                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
     4063                        "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
     4064                        "dev": true
     4065                },
     4066                "babel-plugin-syntax-export-extensions": {
     4067                        "version": "6.13.0",
     4068                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz",
     4069                        "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=",
     4070                        "dev": true
     4071                },
     4072                "babel-plugin-syntax-function-bind": {
     4073                        "version": "6.13.0",
     4074                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz",
     4075                        "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=",
     4076                        "dev": true
     4077                },
     4078                "babel-plugin-syntax-object-rest-spread": {
     4079                        "version": "6.13.0",
     4080                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
     4081                        "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=",
     4082                        "dev": true
     4083                },
     4084                "babel-plugin-syntax-trailing-function-commas": {
     4085                        "version": "6.22.0",
     4086                        "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
     4087                        "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
     4088                        "dev": true
     4089                },
     4090                "babel-plugin-transform-async-generator-functions": {
     4091                        "version": "6.24.1",
     4092                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
     4093                        "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=",
     4094                        "dev": true,
     4095                        "requires": {
     4096                                "babel-helper-remap-async-to-generator": "^6.24.1",
     4097                                "babel-plugin-syntax-async-generators": "^6.5.0",
     4098                                "babel-runtime": "^6.22.0"
     4099                        }
     4100                },
     4101                "babel-plugin-transform-async-to-generator": {
     4102                        "version": "6.24.1",
     4103                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
     4104                        "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
     4105                        "dev": true,
     4106                        "requires": {
     4107                                "babel-helper-remap-async-to-generator": "^6.24.1",
     4108                                "babel-plugin-syntax-async-functions": "^6.8.0",
     4109                                "babel-runtime": "^6.22.0"
     4110                        }
     4111                },
     4112                "babel-plugin-transform-class-constructor-call": {
     4113                        "version": "6.24.1",
     4114                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz",
     4115                        "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=",
     4116                        "dev": true,
     4117                        "requires": {
     4118                                "babel-plugin-syntax-class-constructor-call": "^6.18.0",
     4119                                "babel-runtime": "^6.22.0",
     4120                                "babel-template": "^6.24.1"
     4121                        }
     4122                },
     4123                "babel-plugin-transform-class-properties": {
     4124                        "version": "6.24.1",
     4125                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz",
     4126                        "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=",
     4127                        "dev": true,
     4128                        "requires": {
     4129                                "babel-helper-function-name": "^6.24.1",
     4130                                "babel-plugin-syntax-class-properties": "^6.8.0",
     4131                                "babel-runtime": "^6.22.0",
     4132                                "babel-template": "^6.24.1"
     4133                        }
     4134                },
     4135                "babel-plugin-transform-decorators": {
     4136                        "version": "6.24.1",
     4137                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz",
     4138                        "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=",
     4139                        "dev": true,
     4140                        "requires": {
     4141                                "babel-helper-explode-class": "^6.24.1",
     4142                                "babel-plugin-syntax-decorators": "^6.13.0",
     4143                                "babel-runtime": "^6.22.0",
     4144                                "babel-template": "^6.24.1",
     4145                                "babel-types": "^6.24.1"
     4146                        }
     4147                },
     4148                "babel-plugin-transform-do-expressions": {
     4149                        "version": "6.22.0",
     4150                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz",
     4151                        "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=",
     4152                        "dev": true,
     4153                        "requires": {
     4154                                "babel-plugin-syntax-do-expressions": "^6.8.0",
     4155                                "babel-runtime": "^6.22.0"
     4156                        }
     4157                },
    39134158                "babel-plugin-transform-es2015-arrow-functions": {
    39144159                        "version": "6.22.0",
    39154160                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
     
    41224367                                "regexpu-core": "^2.0.0"
    41234368                        }
    41244369                },
     4370                "babel-plugin-transform-exponentiation-operator": {
     4371                        "version": "6.24.1",
     4372                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
     4373                        "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
     4374                        "dev": true,
     4375                        "requires": {
     4376                                "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
     4377                                "babel-plugin-syntax-exponentiation-operator": "^6.8.0",
     4378                                "babel-runtime": "^6.22.0"
     4379                        }
     4380                },
     4381                "babel-plugin-transform-export-extensions": {
     4382                        "version": "6.22.0",
     4383                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz",
     4384                        "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=",
     4385                        "dev": true,
     4386                        "requires": {
     4387                                "babel-plugin-syntax-export-extensions": "^6.8.0",
     4388                                "babel-runtime": "^6.22.0"
     4389                        }
     4390                },
     4391                "babel-plugin-transform-function-bind": {
     4392                        "version": "6.22.0",
     4393                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz",
     4394                        "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=",
     4395                        "dev": true,
     4396                        "requires": {
     4397                                "babel-plugin-syntax-function-bind": "^6.8.0",
     4398                                "babel-runtime": "^6.22.0"
     4399                        }
     4400                },
     4401                "babel-plugin-transform-object-rest-spread": {
     4402                        "version": "6.26.0",
     4403                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz",
     4404                        "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=",
     4405                        "dev": true,
     4406                        "requires": {
     4407                                "babel-plugin-syntax-object-rest-spread": "^6.8.0",
     4408                                "babel-runtime": "^6.26.0"
     4409                        }
     4410                },
    41254411                "babel-plugin-transform-regenerator": {
    41264412                        "version": "6.26.0",
    41274413                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
     
    41804466                                "babel-plugin-jest-hoist": "^24.6.0"
    41814467                        }
    41824468                },
     4469                "babel-preset-stage-0": {
     4470                        "version": "6.24.1",
     4471                        "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz",
     4472                        "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=",
     4473                        "dev": true,
     4474                        "requires": {
     4475                                "babel-plugin-transform-do-expressions": "^6.22.0",
     4476                                "babel-plugin-transform-function-bind": "^6.22.0",
     4477                                "babel-preset-stage-1": "^6.24.1"
     4478                        }
     4479                },
     4480                "babel-preset-stage-1": {
     4481                        "version": "6.24.1",
     4482                        "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz",
     4483                        "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=",
     4484                        "dev": true,
     4485                        "requires": {
     4486                                "babel-plugin-transform-class-constructor-call": "^6.24.1",
     4487                                "babel-plugin-transform-export-extensions": "^6.22.0",
     4488                                "babel-preset-stage-2": "^6.24.1"
     4489                        }
     4490                },
     4491                "babel-preset-stage-2": {
     4492                        "version": "6.24.1",
     4493                        "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
     4494                        "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=",
     4495                        "dev": true,
     4496                        "requires": {
     4497                                "babel-plugin-syntax-dynamic-import": "^6.18.0",
     4498                                "babel-plugin-transform-class-properties": "^6.24.1",
     4499                                "babel-plugin-transform-decorators": "^6.24.1",
     4500                                "babel-preset-stage-3": "^6.24.1"
     4501                        }
     4502                },
     4503                "babel-preset-stage-3": {
     4504                        "version": "6.24.1",
     4505                        "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz",
     4506                        "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=",
     4507                        "dev": true,
     4508                        "requires": {
     4509                                "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
     4510                                "babel-plugin-transform-async-generator-functions": "^6.24.1",
     4511                                "babel-plugin-transform-async-to-generator": "^6.24.1",
     4512                                "babel-plugin-transform-exponentiation-operator": "^6.24.1",
     4513                                "babel-plugin-transform-object-rest-spread": "^6.22.0"
     4514                        }
     4515                },
    41834516                "babel-register": {
    41844517                        "version": "6.26.0",
    41854518                        "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
     
    58376170                                }
    58386171                        }
    58396172                },
     6173                "copyfiles": {
     6174                        "version": "2.1.1",
     6175                        "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.1.1.tgz",
     6176                        "integrity": "sha512-y6DZHve80whydXzBal7r70TBgKMPKesVRR1Sn/raUu7Jh/i7iSLSyGvYaq0eMJ/3Y/CKghwzjY32q1WzEnpp3Q==",
     6177                        "dev": true,
     6178                        "requires": {
     6179                                "glob": "^7.0.5",
     6180                                "minimatch": "^3.0.3",
     6181                                "mkdirp": "^0.5.1",
     6182                                "noms": "0.0.0",
     6183                                "through2": "^2.0.1",
     6184                                "yargs": "^13.2.4"
     6185                        },
     6186                        "dependencies": {
     6187                                "ansi-regex": {
     6188                                        "version": "4.1.0",
     6189                                        "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
     6190                                        "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
     6191                                        "dev": true
     6192                                },
     6193                                "ansi-styles": {
     6194                                        "version": "3.2.1",
     6195                                        "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
     6196                                        "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
     6197                                        "dev": true,
     6198                                        "requires": {
     6199                                                "color-convert": "^1.9.0"
     6200                                        }
     6201                                },
     6202                                "camelcase": {
     6203                                        "version": "5.3.1",
     6204                                        "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
     6205                                        "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
     6206                                        "dev": true
     6207                                },
     6208                                "cliui": {
     6209                                        "version": "5.0.0",
     6210                                        "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
     6211                                        "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
     6212                                        "dev": true,
     6213                                        "requires": {
     6214                                                "string-width": "^3.1.0",
     6215                                                "strip-ansi": "^5.2.0",
     6216                                                "wrap-ansi": "^5.1.0"
     6217                                        }
     6218                                },
     6219                                "find-up": {
     6220                                        "version": "3.0.0",
     6221                                        "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
     6222                                        "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
     6223                                        "dev": true,
     6224                                        "requires": {
     6225                                                "locate-path": "^3.0.0"
     6226                                        }
     6227                                },
     6228                                "get-caller-file": {
     6229                                        "version": "2.0.5",
     6230                                        "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
     6231                                        "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
     6232                                        "dev": true
     6233                                },
     6234                                "locate-path": {
     6235                                        "version": "3.0.0",
     6236                                        "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
     6237                                        "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
     6238                                        "dev": true,
     6239                                        "requires": {
     6240                                                "p-locate": "^3.0.0",
     6241                                                "path-exists": "^3.0.0"
     6242                                        }
     6243                                },
     6244                                "p-limit": {
     6245                                        "version": "2.2.0",
     6246                                        "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
     6247                                        "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
     6248                                        "dev": true,
     6249                                        "requires": {
     6250                                                "p-try": "^2.0.0"
     6251                                        }
     6252                                },
     6253                                "p-locate": {
     6254                                        "version": "3.0.0",
     6255                                        "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
     6256                                        "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
     6257                                        "dev": true,
     6258                                        "requires": {
     6259                                                "p-limit": "^2.0.0"
     6260                                        }
     6261                                },
     6262                                "p-try": {
     6263                                        "version": "2.2.0",
     6264                                        "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
     6265                                        "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
     6266                                        "dev": true
     6267                                },
     6268                                "require-main-filename": {
     6269                                        "version": "2.0.0",
     6270                                        "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
     6271                                        "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
     6272                                        "dev": true
     6273                                },
     6274                                "string-width": {
     6275                                        "version": "3.1.0",
     6276                                        "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
     6277                                        "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
     6278                                        "dev": true,
     6279                                        "requires": {
     6280                                                "emoji-regex": "^7.0.1",
     6281                                                "is-fullwidth-code-point": "^2.0.0",
     6282                                                "strip-ansi": "^5.1.0"
     6283                                        }
     6284                                },
     6285                                "strip-ansi": {
     6286                                        "version": "5.2.0",
     6287                                        "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
     6288                                        "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
     6289                                        "dev": true,
     6290                                        "requires": {
     6291                                                "ansi-regex": "^4.1.0"
     6292                                        }
     6293                                },
     6294                                "wrap-ansi": {
     6295                                        "version": "5.1.0",
     6296                                        "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
     6297                                        "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
     6298                                        "dev": true,
     6299                                        "requires": {
     6300                                                "ansi-styles": "^3.2.0",
     6301                                                "string-width": "^3.0.0",
     6302                                                "strip-ansi": "^5.0.0"
     6303                                        }
     6304                                },
     6305                                "y18n": {
     6306                                        "version": "4.0.0",
     6307                                        "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
     6308                                        "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
     6309                                        "dev": true
     6310                                },
     6311                                "yargs": {
     6312                                        "version": "13.3.0",
     6313                                        "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
     6314                                        "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
     6315                                        "dev": true,
     6316                                        "requires": {
     6317                                                "cliui": "^5.0.0",
     6318                                                "find-up": "^3.0.0",
     6319                                                "get-caller-file": "^2.0.1",
     6320                                                "require-directory": "^2.1.1",
     6321                                                "require-main-filename": "^2.0.0",
     6322                                                "set-blocking": "^2.0.0",
     6323                                                "string-width": "^3.0.0",
     6324                                                "which-module": "^2.0.0",
     6325                                                "y18n": "^4.0.0",
     6326                                                "yargs-parser": "^13.1.1"
     6327                                        }
     6328                                },
     6329                                "yargs-parser": {
     6330                                        "version": "13.1.1",
     6331                                        "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
     6332                                        "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
     6333                                        "dev": true,
     6334                                        "requires": {
     6335                                                "camelcase": "^5.0.0",
     6336                                                "decamelize": "^1.2.0"
     6337                                        }
     6338                                }
     6339                        }
     6340                },
    58406341                "core-js": {
    58416342                        "version": "3.1.4",
    58426343                        "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.4.tgz",
     
    59506451                                "sha.js": "^2.4.8"
    59516452                        }
    59526453                },
     6454                "cross-env": {
     6455                        "version": "5.2.0",
     6456                        "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz",
     6457                        "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
     6458                        "dev": true,
     6459                        "requires": {
     6460                                "cross-spawn": "^6.0.5",
     6461                                "is-windows": "^1.0.0"
     6462                        },
     6463                        "dependencies": {
     6464                                "cross-spawn": {
     6465                                        "version": "6.0.5",
     6466                                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
     6467                                        "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
     6468                                        "dev": true,
     6469                                        "requires": {
     6470                                                "nice-try": "^1.0.4",
     6471                                                "path-key": "^2.0.1",
     6472                                                "semver": "^5.5.0",
     6473                                                "shebang-command": "^1.2.0",
     6474                                                "which": "^1.2.9"
     6475                                        }
     6476                                }
     6477                        }
     6478                },
    59536479                "cross-spawn": {
    59546480                        "version": "5.1.0",
    59556481                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
     
    59606486                                "which": "^1.2.9"
    59616487                        }
    59626488                },
     6489                "cross-var": {
     6490                        "version": "1.1.0",
     6491                        "resolved": "https://registry.npmjs.org/cross-var/-/cross-var-1.1.0.tgz",
     6492                        "integrity": "sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY=",
     6493                        "dev": true,
     6494                        "requires": {
     6495                                "babel-preset-es2015": "^6.18.0",
     6496                                "babel-preset-stage-0": "^6.16.0",
     6497                                "babel-register": "^6.18.0",
     6498                                "cross-spawn": "^5.0.1",
     6499                                "exit": "^0.1.2"
     6500                        }
     6501                },
    59636502                "crypto-browserify": {
    59646503                        "version": "3.12.0",
    59656504                        "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
     
    70707609                                "is-obj": "^1.0.0"
    70717610                        }
    70727611                },
     7612                "dotenv-cli": {
     7613                        "version": "2.0.1",
     7614                        "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-2.0.1.tgz",
     7615                        "integrity": "sha512-RnjvnE+r27ni9j93w1ddMs9mQgxWlRozSfby7M4xVDJ5/DgLOFFAP92JrmXHkpn8dXCy+OObRx+w5wx0Dc3yww==",
     7616                        "dev": true,
     7617                        "requires": {
     7618                                "cross-spawn": "^4.0.0",
     7619                                "dotenv": "^7.0.0",
     7620                                "dotenv-expand": "^5.0.0",
     7621                                "minimist": "^1.1.3"
     7622                        },
     7623                        "dependencies": {
     7624                                "cross-spawn": {
     7625                                        "version": "4.0.2",
     7626                                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
     7627                                        "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
     7628                                        "dev": true,
     7629                                        "requires": {
     7630                                                "lru-cache": "^4.0.1",
     7631                                                "which": "^1.2.9"
     7632                                        }
     7633                                },
     7634                                "dotenv": {
     7635                                        "version": "7.0.0",
     7636                                        "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz",
     7637                                        "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==",
     7638                                        "dev": true
     7639                                },
     7640                                "minimist": {
     7641                                        "version": "1.2.0",
     7642                                        "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
     7643                                        "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     7644                                        "dev": true
     7645                                }
     7646                        }
     7647                },
     7648                "dotenv-expand": {
     7649                        "version": "5.1.0",
     7650                        "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
     7651                        "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
     7652                        "dev": true
     7653                },
    70737654                "download": {
    70747655                        "version": "4.4.3",
    70757656                        "resolved": "https://registry.npmjs.org/download/-/download-4.4.3.tgz",
     
    1111511696                                "minimalistic-crypto-utils": "^1.0.1"
    1111611697                        }
    1111711698                },
    11118                 "hoek": {
    11119                         "version": "5.0.4",
    11120                         "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz",
    11121                         "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==",
    11122                         "dev": true
    11123                 },
    1112411699                "hoist-non-react-statics": {
    1112511700                        "version": "2.5.5",
    1112611701                        "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
     
    1226712842                        "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
    1226812843                        "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
    1226912844                },
    12270                 "isemail": {
    12271                         "version": "3.2.0",
    12272                         "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
    12273                         "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
    12274                         "dev": true,
    12275                         "requires": {
    12276                                 "punycode": "2.x.x"
    12277                         },
    12278                         "dependencies": {
    12279                                 "punycode": {
    12280                                         "version": "2.1.1",
    12281                                         "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
    12282                                         "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
    12283                                         "dev": true
    12284                                 }
    12285                         }
    12286                 },
    1228712845                "isexe": {
    1228812846                        "version": "2.0.0",
    1228912847                        "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
     
    1375614314                                }
    1375714315                        }
    1375814316                },
    13759                 "joi": {
    13760                         "version": "13.7.0",
    13761                         "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz",
    13762                         "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==",
    13763                         "dev": true,
    13764                         "requires": {
    13765                                 "hoek": "5.x.x",
    13766                                 "isemail": "3.x.x",
    13767                                 "topo": "3.x.x"
    13768                         }
    13769                 },
    1377014317                "jpegtran-bin": {
    1377114318                        "version": "3.2.0",
    1377214319                        "resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-3.2.0.tgz",
     
    1559816145                        "dev": true,
    1559916146                        "optional": true
    1560016147                },
     16148                "noms": {
     16149                        "version": "0.0.0",
     16150                        "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
     16151                        "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=",
     16152                        "dev": true,
     16153                        "requires": {
     16154                                "inherits": "^2.0.1",
     16155                                "readable-stream": "~1.0.31"
     16156                        },
     16157                        "dependencies": {
     16158                                "isarray": {
     16159                                        "version": "0.0.1",
     16160                                        "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
     16161                                        "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
     16162                                        "dev": true
     16163                                },
     16164                                "readable-stream": {
     16165                                        "version": "1.0.34",
     16166                                        "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
     16167                                        "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
     16168                                        "dev": true,
     16169                                        "requires": {
     16170                                                "core-util-is": "~1.0.0",
     16171                                                "inherits": "~2.0.1",
     16172                                                "isarray": "0.0.1",
     16173                                                "string_decoder": "~0.10.x"
     16174                                        }
     16175                                },
     16176                                "string_decoder": {
     16177                                        "version": "0.10.31",
     16178                                        "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
     16179                                        "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
     16180                                        "dev": true
     16181                                }
     16182                        }
     16183                },
    1560116184                "nopt": {
    1560216185                        "version": "3.0.6",
    1560316186                        "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
     
    2052421107                        "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
    2052521108                        "dev": true
    2052621109                },
    20527                 "topo": {
    20528                         "version": "3.0.3",
    20529                         "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
    20530                         "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
    20531                         "dev": true,
    20532                         "requires": {
    20533                                 "hoek": "6.x.x"
    20534                         },
    20535                         "dependencies": {
    20536                                 "hoek": {
    20537                                         "version": "6.1.3",
    20538                                         "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
    20539                                         "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==",
    20540                                         "dev": true
    20541                                 }
    20542                         }
    20543                 },
    2054421110                "toposort": {
    2054521111                        "version": "2.0.2",
    2054621112                        "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz",
     
    2133421900                        }
    2133521901                },
    2133621902                "wait-on": {
    21337                         "version": "3.2.0",
    21338                         "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-3.2.0.tgz",
    21339                         "integrity": "sha512-QUGNKlKLDyY6W/qHdxaRlXUAgLPe+3mLL/tRByHpRNcHs/c7dZXbu+OnJWGNux6tU1WFh/Z8aEwvbuzSAu79Zg==",
     21903                        "version": "3.3.0",
     21904                        "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-3.3.0.tgz",
     21905                        "integrity": "sha512-97dEuUapx4+Y12aknWZn7D25kkjMk16PbWoYzpSdA8bYpVfS6hpl2a2pOWZ3c+Tyt3/i4/pglyZctG3J4V1hWQ==",
    2134021906                        "dev": true,
    2134121907                        "requires": {
    21342                                 "core-js": "^2.5.7",
    21343                                 "joi": "^13.0.0",
     21908                                "@hapi/joi": "^15.0.3",
     21909                                "core-js": "^2.6.5",
    2134421910                                "minimist": "^1.2.0",
    2134521911                                "request": "^2.88.0",
    2134621912                                "rx": "^4.1.0"
  • package.json

    diff --git a/package.json b/package.json
    index 918109d263..8487c01dcc 100644
    a b  
    2222                "babel-jest": "24.8.0",
    2323                "check-node-version": "3.2.0",
    2424                "copy-webpack-plugin": "^4.6.0",
     25                "copyfiles": "2.1.1",
    2526                "core-js": "3.1.4",
     27                "cross-env": "5.2.0",
     28                "cross-var": "1.1.0",
    2629                "cssnano": "4.1.8",
     30                "dotenv-cli": "2.0.1",
    2731                "grunt": "~1.0.3",
    2832                "grunt-banner": "^0.6.0",
    2933                "grunt-contrib-clean": "~2.0.0",
     
    5357                "source-map-loader": "^0.2.4",
    5458                "uglify-js": "^3.4.9",
    5559                "uglifyjs-webpack-plugin": "2.1.1",
     60                "wait-on": "3.3.0",
    5661                "webpack": "4.29.2",
    5762                "webpack-dev-server": "3.1.14",
    5863                "webpack-livereload-plugin": "2.2.0"
     
    123128                "test": "grunt test",
    124129                "watch": "grunt watch",
    125130                "grunt": "grunt",
    126                 "env:start": "./tools/local-env/start.sh",
    127                 "env:reset-site": "./tools/local-env/install-wordpress.sh --reset-site",
    128                 "test:e2e": "wp-scripts test-e2e --config tests/e2e/jest.config.js"
     131                "env:start": "dotenv npm run env:start-next",
     132                "env:start-next": "docker-compose -f ./tools/local-env/docker-compose.yml up -d",
     133                "env:stop": "dotenv npm run env:stop-next",
     134                "env:clean": "dotenv npm run env:stop-next -- -- -v --remove-orphans",
     135                "env:reset": "dotenv npm run env:stop-next -- -- --rmi all -v --remove-orphans",
     136                "env:stop-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml down",
     137                "env:install": "dotenv npm run env:install-next",
     138                "env:install-next": "npm run env:install-config && npm run env:reset-site && npm run env:install-site",
     139                "env:install-config": "cross-var npm run env:cli-next config create -- --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --extra-php=\"$LOCAL_WP_CONFIG\" --force && copyfiles -f src/wp-config.php .",
     140                "env:install-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && cross-var npm run env:cli-next core install -- --title=WPDEV --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$LOCAL_PORT --quiet",
     141                "env:reset-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && npm run env:cli-next db reset -- --yes --quiet",
     142                "env:cli": "dotenv npm run env:cli-next",
     143                "env:cli-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm cli",
     144                "test:e2e": "dotenv npm run test:e2e-next",
     145                "test:e2e-next": "cross-var cross-env WP_BASE_URL=http://localhost:$LOCAL_PORT wp-scripts test-e2e --config tests/e2e/jest.config.js",
     146                "test:php": "dotenv npm run test:php-next",
     147                "test:php-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm phpunit phpunit"
    129148        }
    130149}
  • new file tools/local-env/default.template

    diff --git a/tools/local-env/default.template b/tools/local-env/default.template
    new file mode 100644
    index 0000000000..e0a161926b
    - +  
     1server {
     2        index index.php index.html;
     3
     4        listen 80 default_server;
     5        listen [::]:80 default_server;
     6
     7        server_name localhost;
     8
     9        client_max_body_size 1g;
     10
     11        error_log  /var/log/nginx/error.log;
     12        access_log /var/log/nginx/access.log;
     13
     14        root /var/www/${LOCAL_DIR};
     15
     16        location / {
     17                try_files $uri $uri/ /index.php?$args;
     18        }
     19
     20        location ~ \.php$ {
     21                try_files $uri =404;
     22                fastcgi_split_path_info ^(.+\.php)(/.+)$;
     23                fastcgi_pass php:9000;
     24                fastcgi_index index.php;
     25                include fastcgi_params;
     26                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     27                fastcgi_param PATH_INFO $fastcgi_path_info;
     28        }
     29}
  • new file tools/local-env/docker-compose.scripts.yml

    diff --git a/tools/local-env/docker-compose.scripts.yml b/tools/local-env/docker-compose.scripts.yml
    new file mode 100644
    index 0000000000..1f42a5261b
    - +  
     1version: '3.7'
     2
     3services:
     4
     5  ##
     6  # The WP CLI container.
     7  ##
     8  cli:
     9    image: wordpressdevelop/cli:${LOCAL_PHP-latest}
     10
     11    networks:
     12      - wpdevnet
     13
     14    environment:
     15      LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
     16
     17    volumes:
     18      - ../../:/var/www
     19
     20    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     21    init: true
     22
     23  ##
     24  # The PHPUnit container.
     25  ##
     26  phpunit:
     27    image: wordpressdevelop/phpunit:${LOCAL_PHP-latest}
     28
     29    networks:
     30      - wpdevnet
     31
     32    environment:
     33      LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
     34
     35    volumes:
     36      - ./phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini
     37      - ../../:/wordpress-develop
     38      - phpunit-uploads:/wordpress-develop/${LOCAL_DIR-src}/wp-content/uploads
     39
     40    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     41    init: true
     42
     43    depends_on:
     44      - mysql
     45
     46volumes:
     47  # Using a volume for the uploads directory improves PHPUnit performance.
     48  phpunit-uploads: {}
  • tools/local-env/docker-compose.yml

    diff --git a/tools/local-env/docker-compose.yml b/tools/local-env/docker-compose.yml
    index 7af351759c..32021df1df 100644
    a b  
    1 version: '3.1'
     1version: '3.7'
    22
    33services:
    4   wordpress:
    5     image: wordpress
    6     restart: always
     4
     5  ##
     6  # The web server container.
     7  ##
     8  wordpress-develop:
     9    image: nginx:alpine
     10
     11    networks:
     12      - wpdevnet
     13
    714    ports:
    8       - 8889:80
     15      - ${LOCAL_PORT-8889}:80
     16
    917    environment:
    10       WORDPRESS_DB_HOST: mysql
    11       WORDPRESS_DB_PASSWORD: example
    12       ABSPATH: /usr/src/wordpress/
    13       WORDPRESS_DEBUG: 1
    14       WORDPRESS_CONFIG_EXTRA: |
    15         define( 'SCRIPT_DEBUG', true );
     18      LOCAL_DIR: ${LOCAL_DIR-src}
     19
    1620    volumes:
    17       - wordpress_data:/var/www/html
    18       - ../../build/:/var/www/html/
     21      - ./default.template:/etc/nginx/conf.d/default.template
     22      - ../../:/var/www
     23
     24    # Load our config file, substituning environment variables into the config.
     25    command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
     26
    1927    depends_on:
    20       - mysql
     28      - php
     29
     30  ##
     31  # The PHP container.
     32  ##
     33  php:
     34    image: wordpressdevelop/php:${LOCAL_PHP-latest}
     35
     36    networks:
     37      - wpdevnet
     38
     39    environment:
     40      LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
    2141
    22   cli:
    23     image: wordpress:cli
    24     restart: always
    25     user: xfs
    2642    volumes:
    27       - wordpress_data:/var/www/html
    28       - ../../build/:/var/www/html/
     43      - ./php-config.ini:/usr/local/etc/php/conf.d/php-config.ini
     44      - ../../:/var/www
     45
    2946    depends_on:
    3047      - mysql
    31       - wordpress
    3248
     49  ##
     50  # The MySQL container.
     51  ##
    3352  mysql:
    34     image: mysql:5.7
    35     restart: always
     53    image: mysql:${LOCAL_MYSQL-latest}
     54
     55    networks:
     56      - wpdevnet
     57
    3658    environment:
    37       MYSQL_ROOT_PASSWORD: example
    38       MYSQL_DATABASE: wordpress_test
     59      MYSQL_ROOT_PASSWORD: password
     60
     61    volumes:
     62      - ./mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
     63      - mysql:/var/lib/mysql
     64
     65    # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
     66    command: --default-authentication-plugin=mysql_native_password
    3967
    4068volumes:
    41   wordpress_data:
     69  # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
     70  mysql: {}
     71
     72networks:
     73  # Creating our own network allows us to connect between containers using their service name.
     74  wpdevnet:
     75    driver: bridge
  • deleted file tools/local-env/includes.sh

    diff --git a/tools/local-env/includes.sh b/tools/local-env/includes.sh
    deleted file mode 100755
    index d0028a1c66..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 ##
    4 # Ask a Yes/No question, and way for a reply.
    5 #
    6 # This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default
    7 # answer. It keeps repeating the question until it gets a valid answer.
    8 #
    9 # @param {string} prompt    The question to ask the user.
    10 # @param {string} [default] Optional. "Y" or "N", for the default option to use if none is entered.
    11 # @param {int}    [timeout] Optional. The number of seconds to wait before using the default option.
    12 #
    13 # @returns {bool} true if the user replies Yes, false if the user replies No.
    14 ##
    15 ask() {
    16     # Source: https://djm.me/ask
    17     local timeout endtime timediff prompt default reply
    18 
    19     while true; do
    20 
    21                 timeout="${3:-}"
    22 
    23         if [ "${2:-}" = "Y" ]; then
    24             prompt="Y/n"
    25             default=Y
    26         elif [ "${2:-}" = "N" ]; then
    27             prompt="y/N"
    28             default=N
    29         else
    30             prompt="y/n"
    31             default=
    32                         timeout=
    33         fi
    34 
    35                 if [ -z "$timeout" ]; then
    36                 # Ask the question (not using "read -p" as it uses stderr not stdout)
    37                 echo -en "$1 [$prompt] "
    38 
    39                 # Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
    40                 read reply </dev/tty
    41                 else
    42                         endtime=$((`date +%s` + $timeout));
    43                         while [ "$endtime" -ge `date +%s` ]; do
    44                                 timediff=$(($endtime - `date +%s`))
    45 
    46                                 echo -en "\r$1 [$prompt] (Default $default in ${timediff}s) "
    47                                 read -t 1 reply </dev/tty
    48 
    49                                 if [ -n "$reply" ]; then
    50                                         break
    51                                 fi
    52                         done
    53                 fi
    54 
    55         # Default?
    56         if [ -z "$reply" ]; then
    57             reply=$default
    58         fi
    59 
    60         # Check if the reply is valid
    61         case "$reply" in
    62             Y*|y*) return 0 ;;
    63             N*|n*) return 1 ;;
    64         esac
    65 
    66     done
    67 }
    68 
    69 ##
    70 # Download from a remote source.
    71 #
    72 # Checks for the existence of curl and wget, then downloads the remote file using the first available option.
    73 #
    74 # @param {string} remote  The remote file to download.
    75 # @param {string} [local] Optional. The local filename to use. If it isn't passed, STDOUT is used.
    76 #
    77 # @return {bool} Whether the download succeeded or not.
    78 ##
    79 download() {
    80     if command_exists "curl"; then
    81         curl -s -o "${2:--}" "$1"
    82     elif command_exists "wget"; then
    83                 wget -nv -O "${2:--}" "$1"
    84     fi
    85 }
    86 
    87 ##
    88 # Add error message formatting to a string, and echo it.
    89 #
    90 # @param {string} message The string to add formatting to.
    91 ##
    92 error_message() {
    93         echo -en "\033[31mERROR\033[0m: $1"
    94 }
    95 
    96 ##
    97 # Add warning message formatting to a string, and echo it.
    98 #
    99 # @param {string} message The string to add formatting to.
    100 ##
    101 warning_message() {
    102         echo -en "\033[33mWARNING\033[0m: $1"
    103 }
    104 
    105 ##
    106 # Add status message formatting to a string, and echo it.
    107 #
    108 # @param {string} message The string to add formatting to.
    109 ##
    110 status_message() {
    111         echo -en "\033[32mSTATUS\033[0m: $1"
    112 }
    113 
    114 ##
    115 # Add formatting to an action string.
    116 #
    117 # @param {string} message The string to add formatting to.
    118 ##
    119 action_format() {
    120         echo -en "\033[32m$1\033[0m"
    121 }
    122 
    123 ##
    124 # Check if the command exists as some sort of executable.
    125 #
    126 # The executable form of the command could be an alias, function, builtin, executable file or shell keyword.
    127 #
    128 # @param {string} command The command to check.
    129 #
    130 # @return {bool} Whether the command exists or not.
    131 ##
    132 command_exists() {
    133         type -t "$1" >/dev/null 2>&1
    134 }
  • deleted file tools/local-env/install-node-nvm.sh

    diff --git a/tools/local-env/install-node-nvm.sh b/tools/local-env/install-node-nvm.sh
    deleted file mode 100755
    index f4c29240ce..0000000000
    + -  
    1 #!/bin/bash
    2 NVM_VERSION=`curl -Ls -w %{url_effective} -o /dev/null https://github.com/nvm-sh/nvm/releases/latest | rev | cut -d '/' -f 1 | rev`
    3 
    4 # Exit if any command fails
    5 set -e
    6 
    7 # Include useful functions
    8 . "$(dirname "$0")/includes.sh"
    9 
    10 # Load NVM
    11 if [ -n "$NVM_DIR" ]; then
    12         # The --no-use option ensures loading NVM doesn't switch the current version.
    13         if [ -f "$NVM_DIR/nvm.sh" ]; then
    14                 . "$NVM_DIR/nvm.sh" --no-use
    15         elif command_exists "brew" && [ -f "$(brew --prefix nvm)/nvm.sh" ]; then
    16                 # use homebrew if that's how nvm was installed
    17                 . "$(brew --prefix nvm)/nvm.sh" --no-use
    18         fi
    19 fi
    20 
    21 # Change to the expected directory
    22 cd "$(dirname "$0")/../.."
    23 
    24 # Check if nvm is installed
    25 if [ "$TRAVIS" != "true" ] && ! command_exists "nvm"; then
    26         if ask "$(error_message "NVM isn't installed, would you like to download and install it automatically?")" Y; then
    27                 # The .bash_profile file needs to exist for NVM to install
    28                 if [ ! -e ~/.bash_profile ]; then
    29                         touch ~/.bash_profile
    30                 fi
    31 
    32                 echo -en $(status_message "Installing NVM..." )
    33                 download "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash >/dev/null 2>&1
    34                 echo ' done!'
    35 
    36                 echo -e $(warning_message "NVM was updated, please run this command to reload it:" )
    37                 echo -e $(warning_message "$(action_format ". \$HOME/.nvm/nvm.sh")" )
    38                 echo -e $(warning_message "After that, re-run the setup script to continue." )
    39         else
    40                 echo -e $(error_message "")
    41                 echo -e $(error_message "Please install NVM manually, then re-run the setup script to continue.")
    42                 echo -e $(error_message "NVM installation instructions can be found here: $(action_format "https://github.com/nvm-sh/nvm")")
    43         fi
    44 
    45         exit 1
    46 fi
    47 
    48 # Check if the current nvm version is up to date.
    49 if [ "$TRAVIS" != "true" ] && [ $NVM_VERSION != "v$(nvm --version)" ]; then
    50         echo -en $(status_message "Updating NVM..." )
    51         download "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash >/dev/null 2>&1
    52         echo ' done!'
    53 
    54         echo -e $(warning_message "NVM was updated, please run this command to reload it:" )
    55         echo -e $(warning_message "$(action_format ". \$HOME/.nvm/nvm.sh")" )
    56         echo -e $(warning_message "After that, re-run the setup script to continue." )
    57         exit 1
    58 fi
    59 
    60 # Check if the current node version is up to date.
    61 if [ "$TRAVIS" != "true" ] && [ "$(nvm current)" != "$(nvm version-remote --lts)" ]; then
    62         echo -e $(warning_message "Node version does not match the latest long term support version. Please run this command to install and use it:" )
    63         echo -e $(warning_message "$(action_format "nvm install")" )
    64         echo -e $(warning_message "After that, re-run the setup script to continue." )
    65         exit 1
    66 fi
    67 
    68 # Install/update packages
    69 echo -e $(status_message "Installing and updating NPM packages..." )
    70 npm install
    71 
    72 # Make sure npm is up-to-date
    73 npm install npm -g
    74 
    75 # There was a bug in NPM that caused changes in package-lock.json. Handle that.
    76 if [ "$TRAVIS" != "true" ] && ! git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
    77         if ask "$(warning_message "Your package-lock.json changed, which may mean there's an issue with your NPM cache. Would you like to try and automatically clean it up?" )" N 10; then
    78                 rm -rf node_modules/
    79                 npm cache clean --force >/dev/null 2>&1
    80                 git checkout package-lock.json
    81 
    82                 echo -e $(status_message "Reinstalling NPM packages..." )
    83                 npm install
    84 
    85                 # Check that it's cleaned up now.
    86                 if git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
    87                         echo -e $(warning_message "Confirmed that the NPM cache is cleaned up." )
    88                 else
    89                         echo -e $(error_message "We were unable to clean the NPM cache, please manually review the changes to package-lock.json. Continuing with the setup process..." )
    90                 fi
    91         else
    92                 echo -e $(warning_message "Please manually review the changes to package-lock.json. Continuing with the setup process..." )
    93         fi
    94 fi
  • deleted file tools/local-env/install-wordpress.sh

    diff --git a/tools/local-env/install-wordpress.sh b/tools/local-env/install-wordpress.sh
    deleted file mode 100755
    index c05542bda7..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails.
    4 set -e
    5 
    6 # Common variables.
    7 DOCKER_COMPOSE_FILE_OPTIONS="-f $(dirname "$0")/docker-compose.yml"
    8 WP_DEBUG=${WP_DEBUG-true}
    9 SCRIPT_DEBUG=${SCRIPT_DEBUG-true}
    10 
    11 # Gutenberg script includes.
    12 . "$(dirname "$0")/includes.sh"
    13 
    14 # These are the containers and values for the development site.
    15 CLI='cli'
    16 CONTAINER='wordpress'
    17 SITE_TITLE='WordPress Dev'
    18 
    19 # Get the host port for the WordPress container.
    20 HOST_PORT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS port $CONTAINER 80 | awk -F : '{printf $2}')
    21 
    22 # Wait until the Docker containers are running and the WordPress site is
    23 # responding to requests.
    24 echo -en $(status_message "Attempting to connect to WordPress...")
    25 until $(curl -L http://localhost:$HOST_PORT -so - 2>&1 | grep -q "WordPress"); do
    26     echo -n '.'
    27     sleep 5
    28 done
    29 echo ''
    30 
    31 # If this is the test site, we reset the database so no posts/comments/etc.
    32 # dirty up the tests.
    33 if [ "$1" == '--reset-site' ]; then
    34         echo -e $(status_message "Resetting test database...")
    35         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI db reset --yes --quiet
    36 fi
    37 
    38 # Install WordPress.
    39 echo -e $(status_message "Installing WordPress...")
    40 # The `-u 33` flag tells Docker to run the command as a particular user and
    41 # prevents permissions errors. See: https://github.com/WordPress/gutenberg/pull/8427#issuecomment-410232369
    42 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core install --title="$SITE_TITLE" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$HOST_PORT --quiet
    43 
    44 if [ "$E2E_ROLE" = "author" ]; then
    45         echo -e $(status_message "Creating an additional author user for testing...")
    46         # Create an additional author user for testing.
    47         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI user create author author@example.com --role=author --user_pass=authpass --quiet
    48         # Assign the existing Hello World post to the author.
    49         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI post update 1 --post_author=2 --quiet
    50 fi
    51 
    52 CURRENT_WP_VERSION=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI core version)
    53 echo -e $(status_message "Current WordPress version: $CURRENT_WP_VERSION...")
    54 
    55 if [ "$WP_VERSION" == "latest" ]; then
    56         # Check for WordPress updates, to make sure we're running the very latest version.
    57         echo -e $(status_message "Updating WordPress to the latest version...")
    58         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update --quiet
    59         echo -e $(status_message "Updating The WordPress Database...")
    60         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update-db --quiet
    61 fi
    62 
    63 # If the 'wordpress' volume wasn't during the down/up earlier, but the post port has changed, we need to update it.
    64 echo -e $(status_message "Checking the site's url...")
    65 CURRENT_URL=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI option get siteurl)
    66 if [ "$CURRENT_URL" != "http://localhost:$HOST_PORT" ]; then
    67         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update home "http://localhost:$HOST_PORT" --quiet
    68         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update siteurl "http://localhost:$HOST_PORT" --quiet
    69 fi
    70 
    71 # Install a dummy favicon to avoid 404 errors.
    72 echo -e $(status_message "Installing a dummy favicon...")
    73 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER touch /var/www/html/favicon.ico
    74 
    75 # Configure site constants.
    76 echo -e $(status_message "Configuring site constants...")
    77 WP_DEBUG_CURRENT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json WP_DEBUG)
    78 if [ $WP_DEBUG != $WP_DEBUG_CURRENT ]; then
    79         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set WP_DEBUG $WP_DEBUG --raw --type=constant --quiet
    80         WP_DEBUG_RESULT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json WP_DEBUG)
    81         echo -e $(status_message "WP_DEBUG: $WP_DEBUG_RESULT...")
    82 fi
    83 SCRIPT_DEBUG_CURRENT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json SCRIPT_DEBUG)
    84 if [ $SCRIPT_DEBUG != $SCRIPT_DEBUG_CURRENT ]; then
    85         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set SCRIPT_DEBUG $SCRIPT_DEBUG --raw --type=constant --quiet
    86         SCRIPT_DEBUG_RESULT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json SCRIPT_DEBUG)
    87         echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_RESULT...")
    88 fi
  • deleted file tools/local-env/launch-containers.sh

    diff --git a/tools/local-env/launch-containers.sh b/tools/local-env/launch-containers.sh
    deleted file mode 100755
    index 412386c495..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails.
    4 set -e
    5 
    6 # Common variables.
    7 DOCKER_COMPOSE_FILE_OPTIONS="-f $(dirname "$0")/docker-compose.yml"
    8 
    9 # Include useful functions.
    10 . "$(dirname "$0")/includes.sh"
    11 
    12 # Check that Docker is installed.
    13 if ! command_exists "docker"; then
    14         echo -e $(error_message "Docker doesn't seem to be installed. Please head on over to the Docker site to download it: $(action_format "https://www.docker.com/products/docker-desktop")")
    15         exit 1
    16 fi
    17 
    18 # Check that Docker is running.
    19 if ! docker info >/dev/null 2>&1; then
    20         echo -e $(error_message "Docker isn't running. Please check that you've started your Docker app, and see it in your system tray.")
    21         exit 1
    22 fi
    23 
    24 # Stop existing containers.
    25 echo -e $(status_message "Stopping Docker containers...")
    26 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS down --remove-orphans >/dev/null
    27 
    28 # Download image updates.
    29 echo -e $(status_message "Downloading Docker image updates...")
    30 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS pull
    31 
    32 # Launch the containers.
    33 echo -e $(status_message "Starting Docker containers...")
    34 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS up -d >/dev/null
  • new file tools/local-env/mysql-init.sql

    diff --git a/tools/local-env/mysql-init.sql b/tools/local-env/mysql-init.sql
    new file mode 100644
    index 0000000000..911d6eb3d2
    - +  
     1/**
     2 * MySQL server init.
     3 *
     4 * SQL queries in this file will be executed the first time the MySQL server is started.
     5 */
     6
     7CREATE DATABASE IF NOT EXISTS wordpress_develop;
     8CREATE DATABASE IF NOT EXISTS wordpress_develop_tests;
  • new file tools/local-env/php-config.ini

    diff --git a/tools/local-env/php-config.ini b/tools/local-env/php-config.ini
    new file mode 100644
    index 0000000000..1f385e924c
    - +  
     1upload_max_filesize = 1G
     2post_max_size = 1G
  • new file tools/local-env/phpunit-config.ini

    diff --git a/tools/local-env/phpunit-config.ini b/tools/local-env/phpunit-config.ini
    new file mode 100644
    index 0000000000..bf4788b33d
    - +  
     1upload_max_filesize = 1G
     2post_max_size = 1G
     3
     4opcache.enable = 1
     5opcache.enable_cli = 1
     6opache.file_cache = /tmp/php-opcache
  • deleted file tools/local-env/start.sh

    diff --git a/tools/local-env/start.sh b/tools/local-env/start.sh
    deleted file mode 100755
    index 8d92b0db51..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails
    4 set -e
    5 
    6 # Include useful functions
    7 . "$(dirname "$0")/includes.sh"
    8 
    9 # Change to the expected directory
    10 cd "$(dirname "$0")/../../"
    11 
    12 # Check Node and NVM are installed
    13 . "$(dirname "$0")/install-node-nvm.sh"
    14 
    15 # Check Docker is installed and running and launch the containers
    16 . "$(dirname "$0")/launch-containers.sh"
    17 
    18 # Set up WordPress Development site.
    19 # Note: we don't bother installing the test site right now, because that's
    20 # done on every time `npm run test-e2e` is run.
    21 . "$(dirname "$0")/install-wordpress.sh"
    22 
    23 ! read -d '' WORDPRESS <<"EOT"
    24                    `-/+osssssssssssso+/-`
    25                ./oys+:.`            `.:+syo/.
    26             .+ys:.   .:/osyyhhhhyyso/:.   ./sy+.
    27           /ys:   -+ydmmmmmmmmmmmmmmmmmmdy+-   :sy/
    28         /h+`  -odmmmmmmmmmmmmmmmmmmmmmmmmmmdo-  `+h/
    29       :ho`  /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmds/   `oh:
    30     `sy.  /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd+        .ys`
    31    .ho  `sdddhhhyhmmmdyyhhhdddddhhhyydmmmmy           oh.
    32   .h+          ``-dmmy.``         ``.ymmmmh            +h.
    33  `ho  `       /mmmmmmmmmmo       .dmmmmmmmms        ~~  oh`
    34  oy  .h`       ymmmmmmmmmm:       /mmmmmmmmmy`      -d.  yo
    35 .d-  ymy       `dmmmmmmmmmd.       ymmmmmmmmmh`     /my  -d.
    36 oy  -mmm+       /mmmmmmmmmmy       .dmmmmmmmmmy     ymm-  yo
    37 h+  +mmmd-       smmmmmmmmmm+       /mmmmmmmmmm-   :mmm+  +h
    38 d/  smmmmh`      `dmmmmmmmmmd`       smmmmmmmmm:  `dmmms  /d
    39 d/  smmmmms       :mmmmmmmmm+        `dmmmmmmmd.  smmmms  /d
    40 h+  +mmmmmm/       smmmmmmmh  +       /mmmmmmmy  /mmmmm+  +h
    41 oy  -mmmmmmd.      `dmmmmmd- +m/       smmmmmd. .dmmmmm-  yo
    42 .d-  ymmmmmmh       :mmmmm+ .dmd-      `dmmmm/  ymmmmmy  -d.
    43  oy  .dmmmmmmo       smmmh  hmmmh`      :mmmy  +mmmmmd.  yo
    44  `ho  -dmmmmmd:      `dmd- ommmmms       smd- .dmmmmd-  oh`
    45   .h+  -dmmmmmd`      :m+ -dmmmmmm:      `do  hmmmmd-  +h.
    46    .ho  .ymmmmmy       + `hmmmmmmmd.      :` ommmmy.  oh.
    47     `sy.  /hmmmm+        ommmmmmmmmy        -dmmh/  .ys`
    48       :ho`  /hmmd-      :mmmmmmmmmmmo      `hmh/  `oh:
    49         /h+`  -odh`    `dmmmmmmmmmmmd:     oo-  `+h/
    50           /ys:   ~~    smmmmmmmmmmmmmd`       :sy/
    51             .+ys/.    `/osyyhhhhyyso/:`   ./sy+.
    52                ./oys+:.`            `.:+syo/.
    53                    `-/+osssssssssssso+/-`
    54 EOT
    55 
    56 CURRENT_URL=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm cli option get siteurl)
    57 
    58 echo -e "\nWelcome to...\n"
    59 echo -e "\033[95m$WORDPRESS\033[0m"
    60 
    61 # Give the user more context to what they should do next: Run the environment and start testing!
    62 echo -e "\nOpen $(action_format "$CURRENT_URL") to get started!"
    63 
    64 echo -e "\n\nAccess the above install using the following credentials:"
    65 echo -e "Default username: $(action_format "admin"), password: $(action_format "password")"