Make WordPress Core

Changeset 61873 for trunk/package.json


Ignore:
Timestamp:
03/10/2026 04:10:38 AM (4 months ago)
Author:
desrosj
Message:

Build/Test Tools: Remove the requirement to clone/build Gutenberg.

This iterates on the changes from [61438] by removing the need to:

  • Check out the WordPress/gutenberg repository at the pinned hash.
  • Run npm install within that checkout.
  • Run npm build within that checkout.

Instead, the build script will now download a prebuilt zip file published to the GitHub Container Registry by a GitHub Actions workflow recently merged to the Gutenberg Repository (related PR: https://github.com/WordPress/gutenberg/pull/75844).

This also removes redundant code responsible for:

  • Copying files from the gutenberg directory to the appropriate locations during the build script in favor of using grunt copy.
  • Modifying built files to replace specific text, such as sourceMappingURL, in favor of grunt replace.

The remaining files within the tools/gutenberg directory have been renamed to remove gutenberg from the file names. Since these are already nested in a gutenberg directory, that was redundant.

Since the intention of the pinned value for the repository in the package.json file is to specify a full-length commit hash, ref has been renamed to sha. In Git ref encompasses branches, tags, and commit hashes, so this hopefully makes it more clear that something like branch-name should not be used.

Follow up to [61438], [61439], [61458], [61492], [61677], [61867].

Props desrosj, dmsnell, westonruter, mcsf, jorbin.
See #64393.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package.json

    r61870 r61873  
    88    },
    99    "gutenberg": {
    10         "ref": "9b8144036fa5faf75de43d4502ff9809fcf689ad"
     10        "sha": "9b8144036fa5faf75de43d4502ff9809fcf689ad",
     11        "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
    1112    },
    1213    "engines": {
     
    112113    },
    113114    "scripts": {
    114         "postinstall": "npm run gutenberg:sync && npm run gutenberg:copy -- --dev",
     115        "postinstall": "npm run gutenberg:download",
    115116        "build": "grunt build",
    116117        "build:dev": "grunt build --dev",
     118        "build:gutenberg": "grunt build:gutenberg",
    117119        "dev": "grunt watch --dev",
    118120        "test": "grunt test",
     
    138140        "test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js",
    139141        "typecheck:php": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan",
    140         "gutenberg:checkout": "node tools/gutenberg/checkout-gutenberg.js",
    141         "gutenberg:build": "node tools/gutenberg/build-gutenberg.js",
    142         "gutenberg:copy": "node tools/gutenberg/copy-gutenberg-build.js",
    143         "gutenberg:sync": "node tools/gutenberg/sync-gutenberg.js",
     142        "gutenberg:copy": "node tools/gutenberg/copy.js",
     143        "gutenberg:download": "node tools/gutenberg/download.js",
    144144        "vendor:copy": "node tools/vendors/copy-vendors.js",
    145145        "sync-gutenberg-packages": "grunt sync-gutenberg-packages",
Note: See TracChangeset for help on using the changeset viewer.