From 08b0b0e3fe4597d7694b41f4b6bcc1596ef72561 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Thu, 11 May 2023 21:33:23 -0700 Subject: [PATCH] Replaced `afterSetup` With Granular Scripts This removes `afterSetup` in favor of an `afterStart` and an `afterClean` script. These will provide a more granular way of handling things. We have also added a `beforeDestroy` script that will help. --- packages/env/CHANGELOG.md | 9 ++++ packages/env/README.md | 24 ++++----- packages/env/lib/cli.js | 8 ++- packages/env/lib/commands/clean.js | 3 +- packages/env/lib/commands/destroy.js | 18 ++++--- packages/env/lib/commands/start.js | 9 ++-- .../get-config-from-environment-vars.js | 51 ++++++++++++++----- packages/env/lib/config/load-config.js | 4 +- packages/env/lib/config/merge-configs.js | 3 +- packages/env/lib/config/parse-config.js | 37 +++++++++----- .../env/lib/config/post-process-config.js | 6 +-- .../__snapshots__/config-integration.js.snap | 11 ++-- .../env/lib/config/test/config-integration.js | 23 +++++++-- packages/env/lib/config/test/merge-configs.js | 10 ++++ packages/env/lib/config/test/parse-config.js | 18 ++++--- .../lib/config/test/post-process-config.js | 8 ++- packages/env/lib/execute-lifecycle-script.js | 2 +- 17 files changed, 162 insertions(+), 82 deletions(-) diff --git a/packages/env/CHANGELOG.md b/packages/env/CHANGELOG.md index cfdbf35f870a34..55621d228a6233 100644 --- a/packages/env/CHANGELOG.md +++ b/packages/env/CHANGELOG.md @@ -2,6 +2,15 @@ ## Unreleased +### Breaking Change + +- Remove `afterSetup` option from `.wp-env.json` and the `WP_ENV_AFTER_SETUP` environment variable in favor of more granular lifecycle scripts. + +### New feature + +- Add `afterStart`, `afterClean`, and `beforeDestroy` lifecycle scripts to a new `lifecycleScripts` key in `.wp-env.json`. +- Add a series of `WP_ENV_LIFECYCLE_SCRIPT_` environment variables for the various lifecycle scripts. + ### Enhancement - Validate whether or not config options exist to prevent accidentally including ones that don't. diff --git a/packages/env/README.md b/packages/env/README.md index 3493c08bf6495b..38b108158a42f4 100644 --- a/packages/env/README.md +++ b/packages/env/README.md @@ -443,7 +443,8 @@ Destroy the WordPress environment. Deletes docker containers, volumes, and networks associated with the WordPress environment and removes local files. Options: - --debug Enable debug output. [boolean] [default: false] + --debug Enable debug output. [boolean] [default: false] + --scripts Execute any configured lifecycle scripts. [boolean] [default: true] ``` ### `wp-env logs [environment]` @@ -559,19 +560,16 @@ These can be overridden by setting a value within the `config` configuration. Se Additionally, the values referencing a URL include the specified port for the given environment. So if you set `testsPort: 3000, port: 2000`, `WP_HOME` (for example) will be `http://localhost:3000` on the tests instance and `http://localhost:2000` on the development instance. -## Lifecycle Hooks - -These hooks are executed at certain points during the lifecycle of a command's execution. Keep in mind that these will be executed on both fresh and existing -environments, so, ensure any commands you build won't break on subsequent executions. - -### After Setup - -Using the `afterSetup` option in `.wp-env.json` files will allow you to configure an arbitrary command to execute after the environment's setup is complete: +## Lifecycle Scripts -- `wp-env start`: Runs when the config changes, WordPress updates, or you pass the `--update` flag. -- `wp-env clean`: Runs after the selected environments have been cleaned. +Using the `lifecycleScripts` option in `.wp-env.json` will allow you to set arbitrary commands to be executed at certain points in the lifecycle. This configuration +can also be overridden using `WP_ENV_LIFECYCLE_SCRIPT_{LIFECYCLE_EVENT}` environment variables, with the remainder being the all-caps snake_case name of the option, for +example, `WP_ENV_LIFECYCLE_SCRIPT_AFTER_START`. Keep in mind that these will be executed on both fresh and existing environments, so, ensure any commands you +build won't break on subsequent executions. -You can override the `afterSetup` option using the `WP_ENV_AFTER_SETUP` environment variable. +* `afterStart`: Runs after `wp-env start` has finished setting up the environment. +* `afterClean`: Runs after `wp-env clean` has finished cleaning the environment. +* `beforeDestroy`: Runs before `wp-env destroy` begins destroying anything. ## Examples @@ -707,7 +705,7 @@ This is useful for performing some actions after setting up the environment, suc ```json { - "afterSetup": "node tests/e2e/bin/setup-env.js" + "afterStart": "node tests/e2e/bin/setup-env.js" } ``` diff --git a/packages/env/lib/cli.js b/packages/env/lib/cli.js index 9720144b8280c2..8b9c751b1783c5 100644 --- a/packages/env/lib/cli.js +++ b/packages/env/lib/cli.js @@ -223,7 +223,13 @@ module.exports = function cli() { wpRed( 'Destroy the WordPress environment. Deletes docker containers, volumes, and networks associated with the WordPress environment and removes local files.' ), - () => {}, + ( args ) => { + args.option( 'scripts', { + type: 'boolean', + describe: 'Execute any configured lifecycle scripts.', + default: true, + } ); + }, withSpinner( env.destroy ) ); yargs.command( diff --git a/packages/env/lib/commands/clean.js b/packages/env/lib/commands/clean.js index 024f71476a9c9d..817b5050211078 100644 --- a/packages/env/lib/commands/clean.js +++ b/packages/env/lib/commands/clean.js @@ -65,9 +65,8 @@ module.exports = async function clean( { await Promise.all( tasks ); - // Execute any configured command that should run after the environment has finished being set up. if ( scripts ) { - executeLifecycleScript( 'afterSetup', config, spinner ); + executeLifecycleScript( 'afterClean', config, spinner ); } spinner.text = `Cleaned ${ description }.`; diff --git a/packages/env/lib/commands/destroy.js b/packages/env/lib/commands/destroy.js index 4d8a7e4ee6d6b8..3543a50de59662 100644 --- a/packages/env/lib/commands/destroy.js +++ b/packages/env/lib/commands/destroy.js @@ -17,21 +17,21 @@ const rimraf = util.promisify( require( 'rimraf' ) ); * Internal dependencies */ const { loadConfig } = require( '../config' ); +const { executeLifecycleScript } = require( '../execute-lifecycle-script' ); /** * Destroy the development server. * * @param {Object} options * @param {Object} options.spinner A CLI spinner which indicates progress. + * @param {boolean} options.scripts Indicates whether or not lifecycle scripts should be executed. * @param {boolean} options.debug True if debug mode is enabled. */ -module.exports = async function destroy( { spinner, debug } ) { - const { dockerComposeConfigPath, workDirectoryPath } = await loadConfig( - path.resolve( '.' ) - ); +module.exports = async function destroy( { spinner, scripts, debug } ) { + const config = await loadConfig( path.resolve( '.' ) ); try { - await fs.readdir( workDirectoryPath ); + await fs.readdir( config.workDirectoryPath ); } catch { spinner.text = 'Could not find any files to remove.'; return; @@ -57,10 +57,14 @@ module.exports = async function destroy( { spinner, debug } ) { return; } + if ( scripts ) { + executeLifecycleScript( 'beforeDestroy', config, spinner ); + } + spinner.text = 'Removing docker images, volumes, and networks.'; await dockerCompose.down( { - config: dockerComposeConfigPath, + config: config.dockerComposeConfigPath, commandOptions: [ '--volumes', '--remove-orphans', '--rmi', 'all' ], log: debug, } ); @@ -70,7 +74,7 @@ module.exports = async function destroy( { spinner, debug } ) { // by this point, which causes rimraf to fail. We need to wait at least 2.5-5s, // but using 10s in case it's dependant on the machine. await new Promise( ( resolve ) => setTimeout( resolve, 10000 ) ); - await rimraf( workDirectoryPath ); + await rimraf( config.workDirectoryPath ); spinner.text = 'Removed WordPress environment.'; }; diff --git a/packages/env/lib/commands/start.js b/packages/env/lib/commands/start.js index ffc30ee40d159e..ac23b2094d29d4 100644 --- a/packages/env/lib/commands/start.js +++ b/packages/env/lib/commands/start.js @@ -203,17 +203,16 @@ module.exports = async function start( { } ), ] ); - // Execute any configured command that should run after the environment has finished being set up. - if ( scripts ) { - executeLifecycleScript( 'afterSetup', config, spinner ); - } - // Set the cache key once everything has been configured. await setCache( CONFIG_CACHE_KEY, configHash, { workDirectoryPath, } ); } + if ( scripts ) { + executeLifecycleScript( 'afterStart', config, spinner ); + } + const siteUrl = config.env.development.config.WP_SITEURL; const testsSiteUrl = config.env.tests.config.WP_SITEURL; diff --git a/packages/env/lib/config/get-config-from-environment-vars.js b/packages/env/lib/config/get-config-from-environment-vars.js index 1447d1a4de2719..490bdfce7232e8 100644 --- a/packages/env/lib/config/get-config-from-environment-vars.js +++ b/packages/env/lib/config/get-config-from-environment-vars.js @@ -16,10 +16,11 @@ const { checkPort, checkVersion, checkString } = require( './validate-config' ); * Environment variable configuration. * * @typedef WPEnvironmentVariableConfig - * @property {?number} port An override for the development environment's port. - * @property {?number} testsPort An override for the testing environment's port. - * @property {?WPSource} coreSource An override for all environment's coreSource. - * @property {?string} phpVersion An override for all environment's PHP version. + * @property {?number} port An override for the development environment's port. + * @property {?number} testsPort An override for the testing environment's port. + * @property {?WPSource} coreSource An override for all environment's coreSource. + * @property {?string} phpVersion An override for all environment's PHP version. + * @property {?Object.} lifecycleScripts An override for various lifecycle scripts. */ /** @@ -33,6 +34,7 @@ module.exports = function getConfigFromEnvironmentVars( cacheDirectoryPath ) { const environmentConfig = { port: getPortFromEnvironmentVariable( 'WP_ENV_PORT' ), testsPort: getPortFromEnvironmentVariable( 'WP_ENV_TESTS_PORT' ), + lifecycleScripts: getLifecycleScriptOverrides(), }; if ( process.env.WP_ENV_CORE ) { @@ -53,15 +55,6 @@ module.exports = function getConfigFromEnvironmentVars( cacheDirectoryPath ) { environmentConfig.phpVersion = process.env.WP_ENV_PHP_VERSION; } - if ( process.env.WP_ENV_AFTER_SETUP ) { - checkString( - 'environment variable', - 'WP_ENV_AFTER_SETUP', - process.env.WP_ENV_AFTER_SETUP - ); - environmentConfig.afterSetup = process.env.WP_ENV_AFTER_SETUP; - } - return environmentConfig; }; @@ -70,7 +63,7 @@ module.exports = function getConfigFromEnvironmentVars( cacheDirectoryPath ) { * * @param {string} varName The environment variable to check (e.g. WP_ENV_PORT). * - * @return {number} The parsed port number + * @return {number} The parsed port number. */ function getPortFromEnvironmentVariable( varName ) { if ( ! process.env[ varName ] ) { @@ -84,3 +77,33 @@ function getPortFromEnvironmentVariable( varName ) { return port; } + +/** + * Parses the lifecycle script environment variables. + * + * @return {Object.} The parsed lifecycle scripts. + */ +function getLifecycleScriptOverrides() { + const lifecycleScripts = {}; + + // Find all of the lifecycle script overrides and parse them. + for ( const env in process.env ) { + const match = env.match( /WP_ENV_LIFECYCLE_SCRIPT_([A-Za-z0-9_]+)/ ); + if ( ! match ) { + continue; + } + + const scriptValue = process.env[ env ]; + checkString( 'environment variable', env, scriptValue ); + + // Convert the snake_case environment variables into a camelCase lifecycle script key. + const scriptKey = match[ 1 ] + .toLowerCase() + .replace( /(_[a-z])/g, ( group ) => + group.toUpperCase().replace( '_', '' ) + ); + lifecycleScripts[ scriptKey ] = scriptValue; + } + + return lifecycleScripts; +} diff --git a/packages/env/lib/config/load-config.js b/packages/env/lib/config/load-config.js index 9311df8f36e095..f8a61d278c8a0a 100644 --- a/packages/env/lib/config/load-config.js +++ b/packages/env/lib/config/load-config.js @@ -68,9 +68,7 @@ module.exports = async function loadConfig( configDirectoryPath ) { configFilePath, getConfigFilePath( configDirectoryPath, 'override' ), ] ), - lifecycleScripts: { - afterSetup: config.afterSetup, - }, + lifecycleScripts: config.lifecycleScripts, env: config.env, }; }; diff --git a/packages/env/lib/config/merge-configs.js b/packages/env/lib/config/merge-configs.js index 4494cea2bfb15f..bccfcc4da3e0dd 100644 --- a/packages/env/lib/config/merge-configs.js +++ b/packages/env/lib/config/merge-configs.js @@ -45,7 +45,8 @@ function mergeConfig( config, toMerge ) { switch ( option ) { // Some config options are merged together instead of entirely replaced. case 'config': - case 'mappings': { + case 'mappings': + case 'lifecycleScripts': { config[ option ] = Object.assign( config[ option ], toMerge[ option ] diff --git a/packages/env/lib/config/parse-config.js b/packages/env/lib/config/parse-config.js index 1181f2f9e6bb3c..319022e71060d8 100644 --- a/packages/env/lib/config/parse-config.js +++ b/packages/env/lib/config/parse-config.js @@ -34,10 +34,10 @@ const mergeConfigs = require( './merge-configs' ); * The root configuration options. * * @typedef WPRootConfigOptions - * @property {number} port The port to use in the development environment. - * @property {number} testsPort The port to use in the tests environment. - * @property {string|null} afterSetup The command(s) to run after configuring WordPress on start and clean. - * @property {Object.} env The environment-specific configuration options. + * @property {number} port The port to use in the development environment. + * @property {number} testsPort The port to use in the tests environment. + * @property {Object.} lifecycleScripts The scripts to run at certain points in the command lifecycle. + * @property {Object.} env The environment-specific configuration options. */ /** @@ -223,7 +223,11 @@ async function getDefaultConfig( // These configuration options are root-only and should not be present // on environment-specific configuration objects. - afterSetup: null, + lifecycleScripts: { + afterStart: null, + afterClean: null, + afterDestroy: null, + }, env: { development: {}, tests: { @@ -250,6 +254,7 @@ function getEnvironmentVarOverrides( cacheDirectoryPath ) { // Create a service config object so we can merge it with the others // and override anything that the configuration options need to. const overrideConfig = { + lifecycleScripts: overrides.lifecycleScripts, env: { development: {}, tests: {}, @@ -282,10 +287,6 @@ function getEnvironmentVarOverrides( cacheDirectoryPath ) { overrideConfig.env.tests.phpVersion = overrides.phpVersion; } - if ( overrides.afterSetup ) { - overrideConfig.afterSetup = overrides.afterSetup; - } - return overrideConfig; } @@ -333,12 +334,20 @@ async function parseRootConfig( configFile, rawConfig, options ) { checkPort( configFile, `testsPort`, rawConfig.testsPort ); parsedConfig.testsPort = rawConfig.testsPort; } - if ( rawConfig.afterSetup !== undefined ) { - // Support null as a valid input. - if ( rawConfig.afterSetup !== null ) { - checkString( configFile, 'afterSetup', rawConfig.afterSetup ); + if ( rawConfig.lifecycleScripts ) { + parsedConfig.lifecycleScripts = {}; + + for ( const key in rawConfig.lifecycleScripts ) { + if ( rawConfig.lifecycleScripts[ key ] !== null ) { + checkString( + configFile, + key, + rawConfig.lifecycleScripts[ key ] + ); + } + parsedConfig.lifecycleScripts[ key ] = + rawConfig.lifecycleScripts[ key ]; } - parsedConfig.afterSetup = rawConfig.afterSetup; } // Parse the environment-specific configs so they're accessible to the root. diff --git a/packages/env/lib/config/post-process-config.js b/packages/env/lib/config/post-process-config.js index 46723b9f3d8c3b..d09843893ea69f 100644 --- a/packages/env/lib/config/post-process-config.js +++ b/packages/env/lib/config/post-process-config.js @@ -59,9 +59,9 @@ function mergeRootToEnvironments( config ) { config.env.tests.port = config.testsPort; delete config.testsPort; } - if ( config.afterSetup !== undefined ) { - removedRootOptions.afterSetup = config.afterSetup; - delete config.afterSetup; + if ( config.lifecycleScripts !== undefined ) { + removedRootOptions.lifecycleScripts = config.lifecycleScripts; + delete config.lifecycleScripts; } // Merge the root config and the environment configs together so that diff --git a/packages/env/lib/config/test/__snapshots__/config-integration.js.snap b/packages/env/lib/config/test/__snapshots__/config-integration.js.snap index 97600b4d8f4809..3647ad383571ac 100644 --- a/packages/env/lib/config/test/__snapshots__/config-integration.js.snap +++ b/packages/env/lib/config/test/__snapshots__/config-integration.js.snap @@ -62,7 +62,8 @@ exports[`Config Integration should load local and override configuration files 1 }, }, "lifecycleScripts": { - "afterSetup": null, + "afterEnd": "test", + "afterStart": null, }, "name": "gutenberg", "workDirectoryPath": "/cache/5fea4c5689ef6cc4a4e6eaaa39323338", @@ -131,7 +132,7 @@ exports[`Config Integration should load local configuration file 1`] = ` }, }, "lifecycleScripts": { - "afterSetup": "test", + "afterStart": "test", }, "name": "gutenberg", "workDirectoryPath": "/cache/5fea4c5689ef6cc4a4e6eaaa39323338", @@ -199,9 +200,7 @@ exports[`Config Integration should use default configuration 1`] = ` "themeSources": [], }, }, - "lifecycleScripts": { - "afterSetup": null, - }, + "lifecycleScripts": {}, "name": "gutenberg", "workDirectoryPath": "/cache/5fea4c5689ef6cc4a4e6eaaa39323338", } @@ -271,7 +270,7 @@ exports[`Config Integration should use environment variables over local and over }, }, "lifecycleScripts": { - "afterSetup": "test", + "afterStart": "test", }, "name": "gutenberg", "workDirectoryPath": "/cache/5fea4c5689ef6cc4a4e6eaaa39323338", diff --git a/packages/env/lib/config/test/config-integration.js b/packages/env/lib/config/test/config-integration.js index 08c3277f06a45d..aa29554a322b3f 100644 --- a/packages/env/lib/config/test/config-integration.js +++ b/packages/env/lib/config/test/config-integration.js @@ -48,7 +48,7 @@ describe( 'Config Integration', () => { delete process.env.WP_ENV_HOME; delete process.env.WP_ENV_PORT; delete process.env.WP_ENV_TESTS_PORT; - delete process.env.WP_ENV_AFTER_SETUP; + delete process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START; } ); it( 'should use default configuration', async () => { @@ -69,7 +69,9 @@ describe( 'Config Integration', () => { return JSON.stringify( { core: 'WordPress/WordPress#trunk', port: 123, - afterSetup: 'test', + lifecycleScripts: { + afterStart: 'test', + }, } ); } @@ -90,12 +92,19 @@ describe( 'Config Integration', () => { core: 'WordPress/WordPress#trunk', port: 123, testsPort: 456, + lifecycleScripts: { + afterStart: 'test', + }, } ); } if ( fileName === '/test/gutenberg/.wp-env.override.json' ) { return JSON.stringify( { port: 999, + lifecycleScripts: { + afterStart: null, + afterEnd: 'test', + }, } ); } @@ -112,7 +121,7 @@ describe( 'Config Integration', () => { it( 'should use environment variables over local and override configuration files', async () => { process.env.WP_ENV_PORT = 12345; process.env.WP_ENV_TESTS_PORT = 61234; - process.env.WP_ENV_AFTER_SETUP = 'test'; + process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START = 'test'; readFile.mockImplementation( async ( fileName ) => { if ( fileName === '/test/gutenberg/.wp-env.json' ) { @@ -120,7 +129,9 @@ describe( 'Config Integration', () => { core: 'WordPress/WordPress#trunk', port: 123, testsPort: 456, - afterSetup: 'local', + lifecycleEvents: { + afterStart: 'local', + }, } ); } @@ -137,6 +148,10 @@ describe( 'Config Integration', () => { expect( config.env.development.port ).toEqual( 12345 ); expect( config.env.tests.port ).toEqual( 61234 ); + expect( config.lifecycleScripts ).toHaveProperty( + 'afterStart', + 'test' + ); expect( config ).toMatchSnapshot(); } ); } ); diff --git a/packages/env/lib/config/test/merge-configs.js b/packages/env/lib/config/test/merge-configs.js index d3769b9d8ff2b6..92358c3e18f130 100644 --- a/packages/env/lib/config/test/merge-configs.js +++ b/packages/env/lib/config/test/merge-configs.js @@ -16,12 +16,18 @@ describe( 'mergeConfigs', () => { config: { WP_TEST: 'test', }, + lifecycleScripts: { + afterStart: 'test', + }, }, { port: 8889, config: { WP_TEST_2: 'test-2', }, + lifecycleScripts: { + afterEnd: 'test-2', + }, } ); @@ -35,6 +41,10 @@ describe( 'mergeConfigs', () => { WP_TEST: 'test', WP_TEST_2: 'test-2', }, + lifecycleScripts: { + afterStart: 'test', + afterEnd: 'test-2', + }, } ); } ); diff --git a/packages/env/lib/config/test/parse-config.js b/packages/env/lib/config/test/parse-config.js index 7edb5a75d6f7c1..97d385c5dd759b 100644 --- a/packages/env/lib/config/test/parse-config.js +++ b/packages/env/lib/config/test/parse-config.js @@ -51,7 +51,7 @@ const DEFAULT_CONFIG = { WP_HOME: 'http://localhost', }, mappings: {}, - afterSetup: null, + lifecycleScripts: {}, env: { development: {}, tests: { @@ -76,7 +76,7 @@ describe( 'parseConfig', () => { delete process.env.WP_ENV_TESTS_PORT; delete process.env.WP_ENV_CORE; delete process.env.WP_ENV_PHP_VERSION; - delete process.env.WP_ENV_AFTER_SETUP; + delete process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START; } ); it( 'should return default config', async () => { @@ -141,7 +141,9 @@ describe( 'parseConfig', () => { return { core: 'WordPress/WordPress#Test', phpVersion: '1.0', - afterSetup: 'test', + lifecycleScripts: { + afterStart: 'test', + }, env: { development: { port: 1234, @@ -181,7 +183,9 @@ describe( 'parseConfig', () => { type: 'git', }, phpVersion: '2.0', - afterSetup: 'test', + lifecycleScripts: { + afterStart: 'test', + }, env: { development: { ...DEFAULT_CONFIG.env.development, @@ -270,7 +274,7 @@ describe( 'parseConfig', () => { process.env.WP_ENV_TESTS_PORT = 456; process.env.WP_ENV_CORE = 'WordPress/WordPress#test'; process.env.WP_ENV_PHP_VERSION = '3.0'; - process.env.WP_ENV_AFTER_SETUP = 'test after'; + process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START = 'test after'; const parsed = await parseConfig( './', '/cache' ); @@ -288,7 +292,9 @@ describe( 'parseConfig', () => { type: 'git', }, phpVersion: '3.0', - afterSetup: 'test after', + lifecycleScripts: { + afterStart: 'test after', + }, env: { development: { port: 123, diff --git a/packages/env/lib/config/test/post-process-config.js b/packages/env/lib/config/test/post-process-config.js index 8559728b969d1d..c64a98c7b2ad00 100644 --- a/packages/env/lib/config/test/post-process-config.js +++ b/packages/env/lib/config/test/post-process-config.js @@ -156,7 +156,9 @@ describe( 'postProcessConfig', () => { const processed = postProcessConfig( { port: 8888, testsPort: 8889, - afterSetup: 'test', + lifecycleScripts: { + afterStart: 'test', + }, env: { development: {}, tests: {}, @@ -166,7 +168,9 @@ describe( 'postProcessConfig', () => { expect( processed ).toEqual( { port: 8888, testsPort: 8889, - afterSetup: 'test', + lifecycleScripts: { + afterStart: 'test', + }, env: { development: { port: 8888, diff --git a/packages/env/lib/execute-lifecycle-script.js b/packages/env/lib/execute-lifecycle-script.js index 811a7a4610f682..88c1fd25a10d62 100644 --- a/packages/env/lib/execute-lifecycle-script.js +++ b/packages/env/lib/execute-lifecycle-script.js @@ -20,7 +20,7 @@ class LifecycleScriptError extends Error { } /** - * Executes any defined afterSetup command. + * Executes any defined life cycle script. * * @param {string} event The lifecycle event to run the script for. * @param {WPConfig} config The config object to use.