Skip to content

Remove build directory from GatherPress repo #1065

@mauteri

Description

@mauteri

Is your enhancement related to a problem? Please describe.

This task requires a few things:

  • Add build to .gitignore file.
  • Change plugin-zip in package.json to also build, eg, npm run build && wp-scripts plugin-zip
  • Deploy to WordPress.org Repository appears to be fine as it has an npm run build as part of process
  • Add a WordPress admin notice when build directory doesn't exist and exit plugin. An example of how this was done for other plugins below. This is not exact, just an example. The message will include relevant link to developer documentation. We also need to update that documentation to include the npm run build command that will be required now.
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
	add_action(
		'admin_notices',
		static function (): void {
			wp_admin_notice(
				sprintf(
				/* translators: %1$s: composer command, %2$s: the plugin path */
					esc_html__( 'Please run %1$s in %2$s to install the required dependencies.', 'textdomain' ),
					'<code>composer install</code>',
					'<code>plugin_name</code>'
				),
				[
					'type' => 'error',
				]
			);
		}
	);

	return;
}
require_once __DIR__ . '/vendor/autoload.php';

This update will make PRs smaller and easier to review as well as create less merge conflicts.

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions