Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/wp-admin/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
);
}

// Check if Gutenberg build files are available
// Check if the build files are available.
if ( ! function_exists( 'wp_font_library_wp_admin_render_page' ) ) {
wp_die(
'<h1>' . __( 'Font Library is not available.' ) . '</h1>' .
'<p>' . __( 'The Font Library requires Gutenberg build files. Please run <code>npm install</code> to build the necessary files.' ) . '</p>',
'<p>' . sprintf(
/* translators: %s: npm run build */
__( 'The Font Library requires build files. Please run %s to build the necessary files.' ),
'<code>npm run build</code>'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On my development environment, npm run build isn't enough and I have to run also npm run dev. Given this is a message for developers, what about entirely removing the command to use and just provide a more generic message? Developers know what to do. Thoughts?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah, good catch.

I looked at dropping the command and linking to docs instead, like src/index.php does. That doesn't work: the handbook page it links has nothing about building, and the other mentions are old make/core posts using the older grunt build --dev form. The one accurate source is this repo's README. We could link that on GitHub, but core has no precedent for it, every user-facing doc link goes to the handbook, so I would rather not introduce that here.

So, three options:

A. Name the command that fits a dev environment:

The Font Library requires build files. Please run npm run build:dev to build the necessary files.

A caveat that this assumes npm install has already run.

B. Drop the command, as you suggested:

The Font Library requires build files. Please build WordPress and try again.

C. Generic wording plus the handbook link:

The Font Library requires build files. Please build WordPress and try again. Learn more about setting up your local development environment.

Last sentence will be hyperlinked to a doc about build toolchain. Currently, there is none.

) . '</p>',
503
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/wp-admin/options-connectors.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
if ( ! class_exists( '\WordPress\AiClient\AiClient' ) || ! function_exists( 'wp_options_connectors_wp_admin_render_page' ) ) {
wp_die(
'<h1>' . __( 'Connectors are not available.' ) . '</h1>' .
'<p>' . __( 'The Connectors page requires build files. Please run <code>npm install</code> to build the necessary files.' ) . '</p>',
'<p>' . sprintf(
/* translators: %s: npm run build */
__( 'The Connectors page requires build files. Please run %s to build the necessary files.' ),
'<code>npm run build</code>'
) . '</p>',
503
);
}
Expand Down
Loading