Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert custom GB 16.3 installation steps and add WP_DEBUG support in local-env #7602

Merged
merged 10 commits into from
Aug 31, 2023
17 changes: 10 additions & 7 deletions .phpstorm.meta.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you know to update this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the mappings for the plugin services factory, which should be the same as AmpWpPlugin::SERVICES and enable auto-completion for SERVICES::get() Since some of the services were misspelled and some were missing from the PHPStorm meta-file, I added them.

Ref: https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html#passing-a-string-literal

Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@
'admin.onboarding_menu' => \AmpProject\AmpWP\Admin\OnboardingWizardSubmenu::class,
'admin.onboarding_wizard' => \AmpProject\AmpWP\Admin\OnboardingWizardSubmenuPage::class,
'admin.options_menu' => \AmpProject\AmpWP\Admin\OptionsMenu::class,
'admin.support_screen' => \AmpProject\AmpWP\Admin\SupportScreen::class,
'admin.support' => \AmpProject\AmpWP\Admin\SupportLink::class,
'admin.paired_browsing' => \AmpProject\AmpWP\Admin\PairedBrowsing::class,
'admin.plugin_row_meta' => \AmpProject\AmpWP\Admin\PluginRowMeta::class,
'admin.support_screen' => \AmpProject\AmpWP\Admin\SupportScreen::class,
'admin.support' => \AmpProject\AmpWP\Admin\SupportLink::class,
'admin.polyfills' => \AmpProject\AmpWP\Admin\Polyfills::class,
'admin.user_rest_endpoint_extension' => \AmpProject\AmpWP\Admin\UserRESTEndpointExtension::class,
'admin.validation_counts' => \AmpProject\AmpWP\Admin\ValidationCounts::class,
'admin.amp_plugins' => \AmpProject\AmpWP\Admin\AmpPlugins::class,
'admin.amp_themes' => \AmpProject\AmpWP\Admin\AmpThemes::class,
'amp_slug_customization_watcher' => \AmpProject\AmpWP\AmpSlugCustomizationWatcher::class,
'background_task_deactivator' => \AmpProject\AmpWP\BackgroundTask\BackgroundTaskDeactivator::class,
'block_uniqid_transformer' => \AmpProject\AmpWP\BlockUniqidTransformer::class,
'cli.command_namespace' => \AmpProject\AmpWP\CliCli\CommandNamespaceRegistration::class,
'cli.optimizer_command' => \AmpProject\AmpWP\CliCli\OptimizerCommand::class,
'cli.transformer_command' => \AmpProject\AmpWP\CliCli\TransformerCommand::class,
'cli.validation_command' => \AmpProject\AmpWP\CliCli\ValidationCommand::class,
'cli.command_namespace' => \AmpProject\AmpWP\Cli\CommandNamespaceRegistration::class,
'cli.optimizer_command' => \AmpProject\AmpWP\Cli\OptimizerCommand::class,
'cli.transformer_command' => \AmpProject\AmpWP\Cli\TransformerCommand::class,
'cli.validation_command' => \AmpProject\AmpWP\Cli\ValidationCommand::class,
'cli.option_command' => \AmpProject\AmpWP\Cli\OptionCommand::class,
'css_transient_cache.ajax_handler' => \AmpProject\AmpWP\Admin\ReenableCssTransientCachingAjaxAction::class,
'css_transient_cache.monitor' => \AmpProject\AmpWP\BackgroundTask\MonitorCssTransientCaching::class,
'dependency_support' => \AmpProject\AmpWP\DependencySupport::class,
Expand Down Expand Up @@ -62,7 +65,7 @@
'url_validation_cron' => \AmpProject\AmpWP\Validation\URLValidationCron::class,
'url_validation_rest_controller' => \AmpProject\AmpWP\Validation\URLValidationRESTController::class,
'validated_url_stylesheet_gc' => \AmpProject\AmpWP\BackgroundTask\ValidatedUrlStylesheetDataGarbageCollection::class,
'validation_data_gc' => \AmpProject\AmpWP\BackgroundTask\ValidationDataGarbageCollection::class,
'validated_data_gc' => \AmpProject\AmpWP\BackgroundTask\ValidationDataGarbageCollection::class,
'validation.scannable_url_provider' => \AmpProject\AmpWP\Validation\ScannableURLProvider::class,
'validation.url_validation_provider' => \AmpProject\AmpWP\Validation\URLValidationProvider::class,
] )
Expand Down
4 changes: 0 additions & 4 deletions bin/local-env/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ services:
- wordpress_data:/var/www/html
- ../../:/var/www/html/wp-content/plugins/amp
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
# @TODO: Remove it once Gutenberg 16.3 is released.
- /tmp/gutenberg/:/var/www/html/wp-content/plugins/gutenberg
depends_on:
- mysql

Expand All @@ -22,8 +20,6 @@ services:
volumes:
- wordpress_data:/var/www/html
- ../../:/var/www/html/wp-content/plugins/amp
# @TODO: Remove it once Gutenberg 16.3 is released.
- /tmp/gutenberg/:/var/www/html/wp-content/plugins/gutenberg
env_file:
- .env.wp
depends_on:
Expand Down
24 changes: 12 additions & 12 deletions bin/local-env/install-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ wp plugin activate amp --quiet

# Install & activate Gutenberg plugin.
echo -e $(status_message "Installing and activating Gutenberg plugin...")

# @TODO: Remove it once Gutnberg 16.3 is released.
# wp plugin install gutenberg --activate --force --quiet
wp plugin activate gutenberg --quiet
wp plugin install gutenberg --activate --force --quiet

# Set pretty permalinks.
echo -e $(status_message "Setting permalink structure...")
wp rewrite structure '%postname%' --hard --quiet

# Configure site constants.
echo -e $(status_message "Configuring site constants...")

# @TODO: Remove this once WP 6.3 is released.
wp config delete WP_DEBUG

# Log WP_DEBUG value.
WP_DEBUG_CURRENT=$(wp config get --type=constant --format=json WP_DEBUG | tr -d '\r')
echo -e $(status_message "WP_DEBUG: $WP_DEBUG_CURRENT...")

# Log SCRIPT_DEBUG value.
if [ "$WP_DEBUG" != $WP_DEBUG_CURRENT ]; then
wp config set WP_DEBUG $WP_DEBUG --raw --type=constant --quiet
WP_DEBUG_RESULT=$(wp config get --type=constant --format=json WP_DEBUG | tr -d '\r')
echo -e $(status_message "WP_DEBUG: $WP_DEBUG_RESULT...")
fi

SCRIPT_DEBUG_CURRENT=$(wp config get --type=constant --format=json SCRIPT_DEBUG | tr -d '\r')
echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_CURRENT...")
if [ "$SCRIPT_DEBUG" != $SCRIPT_DEBUG_CURRENT ]; then
wp config set SCRIPT_DEBUG $SCRIPT_DEBUG --raw --type=constant --quiet
SCRIPT_DEBUG_RESULT=$(wp config get --type=constant --format=json SCRIPT_DEBUG | tr -d '\r')
echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_RESULT...")
fi
5 changes: 0 additions & 5 deletions bin/local-env/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ cd "$(dirname "$0")/../.."
# Check whether Composer installed
. "$(dirname "$0")/install-composer.sh"

# @TODO: Remove it once Gutnberg 16.3 is released.
rm -rf /tmp/gutenberg /tmp/gutenberg.zip
wget https://amp-wp.org/wp-content/uploads/2023/07/gutenberg.zip -O /tmp/gutenberg.zip
unzip /tmp/gutenberg.zip -d /tmp/gutenberg

# Check whether Docker is installed and running
. "$(dirname "$0")/launch-containers.sh"

Expand Down
75 changes: 69 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@wordpress/browserslist-config": "5.20.0",
"@wordpress/data": "9.7.0",
"@wordpress/dependency-extraction-webpack-plugin": "4.20.0",
"@wordpress/e2e-test-utils": "10.8.0",
"@wordpress/e2e-test-utils": "10.11.0",
"@wordpress/edit-post": "7.14.0",
"@wordpress/env": "8.3.0",
"@wordpress/eslint-plugin": "14.10.0",
Expand Down
Loading