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

Prevent copying PHP files from src/ into assets/ #6952

Merged
merged 1 commit into from Mar 2, 2022

Conversation

delawski
Copy link
Collaborator

@delawski delawski commented Mar 2, 2022

Summary

Fixes #6947

After introducing WordPress/gutenberg#38715, PHP files from the src folder are copied over to the output directory (i.e. assets). To prevent this, the CopyWebpackPlugin is excluded from the webpack shared plugins list.

It is safe to do so since the only other file type CopyWebpackPlugin copies is block.json that is not used in amp-wp.

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

After introducing WordPress/gutenberg#38715, PHP files from the `src` folder are copied over to the output directory (i.e. `assets`). To prevent this, the `CopyWebpackPlugin` is excluded from the plugins list. It is safe since the only other file type the plugin copies is `block.json` that is not used in `amp-wp`.
@delawski delawski added Bug Something isn't working Infrastructure Changes impacting testing infrastructure or build tooling labels Mar 2, 2022
@delawski delawski added this to the v2.2.2 milestone Mar 2, 2022
@delawski delawski self-assigned this Mar 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2022

Plugin builds for 78e0341 are ready 🛎️!

@westonruter westonruter merged commit ea154b5 into develop Mar 2, 2022
@westonruter westonruter deleted the fix/6947-prevent-copying-php-into-assets branch March 2, 2022 21:00
@westonruter
Copy link
Member

@delawski After merging this, removing assets/js/, and then re-running npm run dev, I'm still seeing the PHP files being copied:

	assets/js/Admin/
	assets/js/AmpSlugCustomizationWatcher.php
	assets/js/AmpWpPlugin.php
	assets/js/AmpWpPluginFactory.php
	assets/js/BackgroundTask/
	assets/js/Cli/
	assets/js/Component/
	assets/js/ConfigurationArgument.php
	assets/js/DependencySupport.php
	assets/js/DevTools/
	assets/js/Dom/
	assets/js/Editor/
	assets/js/Embed/
	assets/js/Exception/
	assets/js/ExtraThemeAndPluginHeaders.php
	assets/js/Icon.php
	assets/js/Infrastructure/
	assets/js/Instrumentation/
	assets/js/LoadingError.php
	assets/js/MobileRedirection.php
	assets/js/ObsoleteBlockAttributeRemover.php
	assets/js/Optimizer/
	assets/js/Option.php
	assets/js/OptionsRESTController.php
	assets/js/PairedRouting.php
	assets/js/PairedUrl.php
	assets/js/PairedUrlStructure.php
	assets/js/PairedUrlStructure/
	assets/js/PluginRegistry.php
	assets/js/PluginSuppression.php
	assets/js/QueryVar.php
	assets/js/ReaderThemeLoader.php
	assets/js/ReaderThemeSupportFeatures.php
	assets/js/RemoteRequest/
	assets/js/Sandboxing.php
	assets/js/Services.php
	assets/js/Support/
	assets/js/Validation/
	assets/js/ValidationExemption.php

westonruter added a commit that referenced this pull request Mar 3, 2022
…m-copying-php

Revert #6952 and bump `@wordpress/scripts` to 22.1.0
westonruter added a commit that referenced this pull request Mar 3, 2022
Also cherry-picks #6953

Co-authored-by: Piotr Delawski <piotr.delawski@gmail.com>
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. Infrastructure Changes impacting testing infrastructure or build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP files are being copied from src/ into assets/
2 participants