WordPress.org

Make WordPress Core

Ticket #47380: 47380.2.diff

File 47380.2.diff, 7.0 KB (added by johnbillion, 7 months ago)
  • .travis.yml

    diff --git a/.travis.yml b/.travis.yml
    index 0e186dc8c7..c866b87e6e 100644
    a b before_script: 
    8989- npm --version
    9090- node --version
    9191- nvm install 10.13.0
    92 - npm install -g grunt-cli
    9392- npm install
    9493- npm prune
    9594- mysql --version
    before_script: 
    101100- which phpunit
    102101- phpunit --version
    103102- curl --version
    104 - grunt --version
    105103- git --version
    106104- svn --version
    107105- locale -a
    108 script: grunt $WP_TRAVISCI
     106script: npm run grunt $WP_TRAVISCI
    109107after_script:
    110108- |
    111109  if [[ "$WP_TEST_REPORTER" == "true" ]]; then
  • appveyor.yml

    diff --git a/appveyor.yml b/appveyor.yml
    index cb0a8ae453..f5d7edf00a 100644
    a b branches: 
    1111install:
    1212  - ps: Install-Product node $env:nodejs_version
    1313  - npm install npm -g
    14   - npm install grunt-cli -g
    1514  - npm install
    1615
    1716before_build:
    before_build: 
    1918  - npm --version
    2019
    2120build_script:
    22   - cmd: "grunt build"
     21  - cmd: "npm run build"
    2322
    2423test: off
    2524
  • package.json

    diff --git a/package.json b/package.json
    index 5dc8dc6756..d8a2b7cf1e 100644
    a b  
    113113                "whatwg-fetch": "3.0.0"
    114114        },
    115115        "scripts": {
     116                "build": "grunt build",
     117                "test": "grunt test",
     118                "watch": "grunt watch",
    116119                "grunt": "grunt"
    117120        }
    118121}
  • src/index.php

    diff --git a/src/index.php b/src/index.php
    index c76c36d72d..747b6db178 100644
    a b $die = __( 'You are running WordPress without JavaScript and CSS files. These ne 
    3434
    3535$die .= '<p>' . sprintf(
    3636        /* translators: %s: npm install */
    37         __( 'Before running any grunt tasks you need to make sure the dependencies are installed. You can install these by running %s.' ),
     37        __( 'Before running any build tasks you need to make sure the dependencies are installed. You can install these by running %s.' ),
    3838        '<code style="color: green;">npm install</code>'
    3939) . '</p>';
    4040
    4141$die .= '<ul>';
    4242$die .= '<li>' . __( 'To build WordPress while developing, run:' ) . '<br /><br />';
    43 $die .= '<code style="color: green;">grunt build --dev</code></li>';
     43$die .= '<code style="color: green;">npm run build --dev</code></li>';
    4444$die .= '<li>' . __( 'To build files automatically when changing the source files, run:' ) . '<br /><br />';
    45 $die .= '<code style="color: green;">grunt watch</code></li>';
     45$die .= '<code style="color: green;">npm run watch</code></li>';
    4646$die .= '<li>' . __( 'To create a production build of WordPress, run:' ) . '<br /><br />';
    47 $die .= '<code style="color: green;">grunt build</code></li>';
     47$die .= '<code style="color: green;">npm run build</code></li>';
    4848$die .= '</ul>';
    4949
    5050$die .= '<p>' . sprintf(
    51         /* translators: 1: NPM URL, 2: Grunt URL, 3: Handbook URL */
    52         __( 'This requires <a href="%1$s">NPM</a> and <a href="%2$s">Grunt</a>. <a href="%3$s">Read more about setting up your local development environment</a>.' ),
     51        /* translators: 1: NPM URL, 2: Handbook URL */
     52        __( 'This requires <a href="%1$s">NPM</a>. <a href="%2$s">Read more about setting up your local development environment</a>.' ),
    5353        'https://www.npmjs.com/get-npm',
    54         'https://gruntjs.com/getting-started',
    5554        __( 'https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/' )
    5655) . '</p>';
    5756
  • src/wp-includes/embed.php

    diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
    index 6bc220e9ad..76d937cd6c 100644
    a b function get_post_embed_html( $width, $height, $post = null ) { 
    446446        } else {
    447447                /*
    448448                 * If you're looking at a src version of this file, you'll see an "include"
    449                  * statement below. This is used by the `grunt build` process to directly
     449                 * statement below. This is used by the `npm run build` process to directly
    450450                 * include a minified version of wp-embed.js, instead of using the
    451451                 * file_get_contents() method from above.
    452452                 *
    function print_embed_styles() { 
    10081008        } else {
    10091009                /*
    10101010                 * If you're looking at a src version of this file, you'll see an "include"
    1011                  * statement below. This is used by the `grunt build` process to directly
     1011                 * statement below. This is used by the `npm run build` process to directly
    10121012                 * include a minified version of wp-oembed-embed.css, instead of using the
    10131013                 * readfile() method from above.
    10141014                 *
    function print_embed_scripts() { 
    10391039        } else {
    10401040                /*
    10411041                 * If you're looking at a src version of this file, you'll see an "include"
    1042                  * statement below. This is used by the `grunt build` process to directly
     1042                 * statement below. This is used by the `npm run build` process to directly
    10431043                 * include a minified version of wp-embed-template.js, instead of using the
    10441044                 * readfile() method from above.
    10451045                 *
  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index 0800f0ef95..30194cac9f 100644
    a b function _print_emoji_detection_script() { 
    55185518
    55195519                /*
    55205520                 * If you're looking at a src version of this file, you'll see an "include"
    5521                  * statement below. This is used by the `grunt build` process to directly
     5521                 * statement below. This is used by the `npm run build` process to directly
    55225522                 * include a minified version of wp-emoji-loader.js, instead of using the
    55235523                 * readfile() method from above.
    55245524                 *
    function wp_staticize_emoji_for_email( $mail ) { 
    57345734 * Returns arrays of emoji data.
    57355735 *
    57365736 * These arrays are automatically built from the regex in twemoji.js - if they need to be updated,
    5737  * you should update the regex there, then run the `grunt precommit:emoji` job.
     5737 * you should update the regex there, then run the `npm run grunt precommit:emoji` job.
    57385738 *
    57395739 * @since 4.9.0
    57405740 * @access private
  • tests/phpunit/includes/bootstrap.php

    diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php
    index 23faca64e5..f46f56d7cb 100644
    a b if ( version_compare( tests_get_phpunit_version(), '8.0', '>=' ) ) { 
    4747}
    4848
    4949if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) {
    50         echo "ERROR: The /build/ directory is missing! Please run `grunt build` prior to running PHPUnit.\n";
     50        echo "ERROR: The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.\n";
    5151        exit( 1 );
    5252}
    5353
  • tests/phpunit/tests/oembed/template.php

    diff --git a/tests/phpunit/tests/oembed/template.php b/tests/phpunit/tests/oembed/template.php
    index 95c532edb0..3d9b2b90c1 100644
    a b class Tests_Embed_Template extends WP_UnitTestCase { 
    309309         * So this test checks for ampersands in build/wp-includes/js/wp-embed.min.js.
    310310         * In many cases, this file will not exist; in those cases, we simply skip the test.
    311311         *
    312          * So when would it be run? We have Travis CI run `grunt test` which then runs, in order,
     312         * So when would it be run? We have Travis CI run `npm run test` which then runs, in order,
    313313         * `qunit:compiled` (which runs the build) and then `phpunit`. Thus, this test will at least be
    314314         * run during continuous integration.
    315315         *